use of org.eclipse.osgi.util.NLS in project linuxtools by eclipse.
the class ValgrindExportWizardPage method createDestinationGroup.
private void createDestinationGroup(Composite top) {
Group destGroup = new Group(top, SWT.SHADOW_OUT);
// $NON-NLS-1$
destGroup.setText(Messages.getString("ValgrindExportWizardPage.Destination_group"));
destGroup.setLayout(new GridLayout(2, false));
destGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
destText = new Text(destGroup, SWT.BORDER);
destText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
destText.addModifyListener(e -> setPageComplete(isValid()));
Button browseButton = new Button(destGroup, SWT.PUSH);
// $NON-NLS-1$
browseButton.setText(Messages.getString("ValgrindExportWizardPage.Browse"));
browseButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
// Prompt for output directory
Shell parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
DirectoryDialog dialog = new DirectoryDialog(parent);
// $NON-NLS-1$
dialog.setText(Messages.getString("ValgrindLaunchConfigurationDelegate.Select_Destination"));
String strpath = dialog.open();
if (strpath != null) {
destText.setText(strpath);
}
}));
}
use of org.eclipse.osgi.util.NLS in project linuxtools by eclipse.
the class ValgrindOptionsTab method createSuppressionsOption.
private void createSuppressionsOption(Composite top) {
Composite browseTop = new Composite(top, SWT.BORDER);
browseTop.setLayout(new GridLayout(2, false));
GridData browseData = new GridData(GridData.FILL_BOTH);
browseTop.setLayoutData(browseData);
Label suppFileLabel = new Label(browseTop, SWT.NONE);
// $NON-NLS-1$
suppFileLabel.setText(Messages.getString("ValgrindOptionsTab.suppressions_file"));
createVerticalSpacer(browseTop, 1);
suppFileList = new List(browseTop, SWT.BORDER);
suppFileList.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite buttonTop = new Composite(browseTop, SWT.NONE);
GridLayout buttonLayout = new GridLayout();
buttonLayout.marginWidth = buttonLayout.marginHeight = 0;
buttonTop.setLayout(buttonLayout);
buttonTop.setLayoutData(new GridData(SWT.CENTER, SWT.BEGINNING, false, false));
// $NON-NLS-1$
Button workspaceBrowseButton = createPushButton(buttonTop, Messages.getString("ValgrindOptionsTab.Workspace"), null);
workspaceBrowseButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
// $NON-NLS-1$
dialog.setTitle(Messages.getString("ValgrindOptionsTab.Select_a_Resource"));
// $NON-NLS-1$
dialog.setMessage(Messages.getString("ValgrindOptionsTab.Select_a_Suppressions_File"));
dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
if (dialog.open() == IDialogConstants.OK_ID) {
IResource resource = (IResource) dialog.getFirstResult();
String arg = resource.getFullPath().toString();
String fileLoc = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", // $NON-NLS-1$
arg);
suppFileList.add(fileLoc);
updateLaunchConfigurationDialog();
}
}));
// $NON-NLS-1$
Button fileBrowseButton = createPushButton(buttonTop, Messages.getString("ValgrindOptionsTab.File_System"), null);
fileBrowseButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
String filePath = null;
FileDialog dialog = new FileDialog(getShell(), SWT.SAVE);
filePath = dialog.open();
if (filePath != null) {
suppFileList.add(filePath);
updateLaunchConfigurationDialog();
}
}));
// $NON-NLS-1$
Button removeButton = createPushButton(buttonTop, Messages.getString("ValgrindOptionsTab.Supp_remove"), null);
removeButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
int[] selected = suppFileList.getSelectionIndices();
if (selected.length > 0) {
suppFileList.remove(selected);
updateLaunchConfigurationDialog();
}
}));
}
use of org.eclipse.osgi.util.NLS in project linuxtools by eclipse.
the class MemcheckToolPage method createControl.
@Override
public void createControl(Composite parent) {
Composite top = new Composite(parent, SWT.NONE);
GridLayout memcheckLayout = new GridLayout(2, true);
top.setLayout(memcheckLayout);
top.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
leakCheckButton = new Button(top, SWT.CHECK);
leakCheckButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// $NON-NLS-1$
leakCheckButton.setText(Messages.getString("MemcheckToolPage.leak_check"));
leakCheckButton.addSelectionListener(selectListener);
Composite leakResTop = new Composite(top, SWT.NONE);
leakResTop.setLayout(new GridLayout(2, false));
leakResTop.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label leakResLabel = new Label(leakResTop, SWT.NONE);
// $NON-NLS-1$
leakResLabel.setText(Messages.getString("MemcheckToolPage.leak_resolution"));
leakResCombo = new Combo(leakResTop, SWT.READ_ONLY);
String[] leakResOpts = { MemcheckLaunchConstants.LEAK_RES_LOW, MemcheckLaunchConstants.LEAK_RES_MED, MemcheckLaunchConstants.LEAK_RES_HIGH };
leakResCombo.setItems(leakResOpts);
leakResCombo.addSelectionListener(selectListener);
Composite freelistTop = new Composite(top, SWT.NONE);
freelistTop.setLayout(new GridLayout(2, false));
freelistTop.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label freelistLabel = new Label(freelistTop, SWT.NONE);
// $NON-NLS-1$
freelistLabel.setText(Messages.getString("MemcheckToolPage.freelist_size"));
freelistSpinner = new Spinner(freelistTop, SWT.BORDER);
freelistSpinner.setMaximum(Integer.MAX_VALUE);
freelistSpinner.addModifyListener(modifyListener);
showReachableButton = new Button(top, SWT.CHECK);
showReachableButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// $NON-NLS-1$
showReachableButton.setText(Messages.getString("MemcheckToolPage.show_reachable"));
showReachableButton.addSelectionListener(selectListener);
partialLoadsButton = new Button(top, SWT.CHECK);
partialLoadsButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// $NON-NLS-1$
partialLoadsButton.setText(Messages.getString("MemcheckToolPage.allow_partial"));
partialLoadsButton.addSelectionListener(selectListener);
undefValueButton = new Button(top, SWT.CHECK);
undefValueButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// $NON-NLS-1$
undefValueButton.setText(Messages.getString("MemcheckToolPage.undef_value_errors"));
undefValueButton.addSelectionListener(selectListener);
// VG >= 3.4.0
if (valgrindVersion == null || valgrindVersion.compareTo(VER_3_4_0) >= 0) {
trackOriginsButton = new Button(top, SWT.CHECK);
trackOriginsButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// $NON-NLS-1$
trackOriginsButton.setText(Messages.getString("MemcheckToolPage.Track_origins"));
trackOriginsButton.addSelectionListener(selectListener);
}
gccWorkaroundButton = new Button(top, SWT.CHECK);
gccWorkaroundButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// $NON-NLS-1$
gccWorkaroundButton.setText(Messages.getString("MemcheckToolPage.gcc_296_workarounds"));
gccWorkaroundButton.addSelectionListener(selectListener);
Composite alignmentTop = new Composite(top, SWT.NONE);
GridLayout alignmentLayout = new GridLayout(2, false);
alignmentLayout.marginWidth = alignmentLayout.marginHeight = 0;
alignmentTop.setLayout(alignmentLayout);
alignmentTop.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
alignmentButton = new Button(alignmentTop, SWT.CHECK);
// $NON-NLS-1$
alignmentButton.setText(Messages.getString("MemcheckToolPage.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);
// VG >= 3.6.0
if (valgrindVersion == null || valgrindVersion.compareTo(VER_3_6_0) >= 0) {
showPossiblyLostButton = new Button(top, SWT.CHECK);
showPossiblyLostButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// $NON-NLS-1$
showPossiblyLostButton.setText(Messages.getString("MemcheckToolPage.Show_Possibly_Lost"));
showPossiblyLostButton.addSelectionListener(selectListener);
}
Composite mallocFillTop = new Composite(top, SWT.NONE);
GridLayout mallocFillLayout = new GridLayout(2, false);
mallocFillLayout.marginWidth = mallocFillLayout.marginHeight = 0;
mallocFillTop.setLayout(mallocFillLayout);
mallocFillTop.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
mallocFillButton = new Button(mallocFillTop, SWT.CHECK);
// $NON-NLS-1$
mallocFillButton.setText(Messages.getString("MemcheckToolPage.Malloc_Fill"));
mallocFillButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
checkMallocFillEnablement();
updateLaunchConfigurationDialog();
}));
mallocFillText = new Text(mallocFillTop, SWT.BORDER);
mallocFillText.setTextLimit(8);
mallocFillText.addModifyListener(modifyListener);
Composite freeFillTop = new Composite(top, SWT.NONE);
GridLayout freeFillLayout = new GridLayout(2, false);
freeFillLayout.marginWidth = freeFillLayout.marginHeight = 0;
freeFillTop.setLayout(freeFillLayout);
freeFillTop.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
freeFillButton = new Button(freeFillTop, SWT.CHECK);
// $NON-NLS-1$
freeFillButton.setText(Messages.getString("MemcheckToolPage.Free_Fill"));
freeFillButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
checkFreeFillEnablement();
updateLaunchConfigurationDialog();
}));
freeFillText = new Text(freeFillTop, SWT.BORDER);
mallocFillText.setTextLimit(8);
freeFillText.addModifyListener(modifyListener);
Composite ignoreRangesTop = new Composite(top, SWT.NONE);
ignoreRangesTop.setLayout(new GridLayout(3, false));
ignoreRangesTop.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
Label ignoreRangesLabel = new Label(ignoreRangesTop, SWT.NONE);
// $NON-NLS-1$
ignoreRangesLabel.setText(Messages.getString("MemcheckToolPage.Ignore_Ranges"));
ignoreRangesLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
createIgnoreRangesControls(ignoreRangesTop);
}
use of org.eclipse.osgi.util.NLS in project linuxtools by eclipse.
the class MemcheckToolPage method createIgnoreRangesControls.
private void createIgnoreRangesControls(Composite top) {
ignoreRangesList = new List(top, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
FontMetrics fm = MemcheckPlugin.getFontMetrics(ignoreRangesList);
ignoreRangesList.setLayoutData(new GridData(Dialog.convertWidthInCharsToPixels(fm, 50), Dialog.convertHeightInCharsToPixels(fm, 5)));
Composite ignoreButtons = new Composite(top, SWT.NONE);
GridLayout ignoreButtonsLayout = new GridLayout();
ignoreButtonsLayout.marginWidth = ignoreButtonsLayout.marginHeight = 0;
ignoreButtons.setLayout(ignoreButtonsLayout);
ignoreButtons.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
Button newButton = new Button(ignoreButtons, SWT.PUSH);
// $NON-NLS-1$
newButton.setText(Messages.getString("MemcheckToolPage.New"));
newButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
newButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
handleIgnoreNewButtonPressed();
updateLaunchConfigurationDialog();
}));
Button removeButton = new Button(ignoreButtons, SWT.PUSH);
// $NON-NLS-1$
removeButton.setText(Messages.getString("MemcheckToolPage.Remove"));
removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
removeButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
handleIgnoreRemoveButtonPressed();
updateLaunchConfigurationDialog();
}));
}
use of org.eclipse.osgi.util.NLS in project linuxtools by eclipse.
the class NewSuppressionWizard method performFinish.
/**
* This method is called when 'Finish' button is pressed in
* the wizard. We will create an operation and run it
* using wizard as execution context.
*/
@Override
public boolean performFinish() {
final String containerName = page.getContainerFullPath().toOSString();
final String fileName = page.getFileName();
IRunnableWithProgress op = monitor -> {
try {
doFinish(containerName, fileName, monitor);
} catch (CoreException e) {
throw new InvocationTargetException(e);
} finally {
monitor.done();
}
};
try {
getContainer().run(true, false, op);
} catch (InterruptedException e) {
return false;
} catch (InvocationTargetException e) {
Throwable realException = e.getTargetException();
// $NON-NLS-1$
MessageDialog.openError(getShell(), Messages.getString("NewSuppressionWizard.performFinish_error"), realException.getMessage());
return false;
}
return true;
}
Aggregations