1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Browse button for Spec Detectors

This commit is contained in:
Andrew Gvozdev 2012-04-17 13:46:26 -04:00
parent 775d00a41d
commit 97615f231b
3 changed files with 19 additions and 6 deletions

View file

@ -19,7 +19,9 @@ import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuilti
import org.eclipse.cdt.utils.ui.controls.ControlFactory; import org.eclipse.cdt.utils.ui.controls.ControlFactory;
import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyEvent;
@ -30,6 +32,7 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
@ -105,13 +108,23 @@ public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettin
Button button = ControlFactory.createPushButton(composite, "Browse..."); Button button = ControlFactory.createPushButton(composite, "Browse...");
button.setEnabled(fEditable); button.setEnabled(fEditable);
button.addSelectionListener(new SelectionAdapter() { button.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent evt) { public void widgetSelected(SelectionEvent evt) {
// handleAddr2LineButtonSelected(); FileDialog dialog = new FileDialog(getShell(), SWT.NONE);
//updateLaunchConfigurationDialog(); dialog.setText(/*PreferencesMessages.BuildLogPreferencePage_ChooseLogFile*/"Choose file");
String fileName = inputCommand.getText();
// taking chance that the first word is a compiler path
int space = fileName.indexOf(' ');
if (space > 0) {
fileName = fileName.substring(0, space);
}
IPath folder = new Path(fileName).removeLastSegments(1);
dialog.setFilterPath(folder.toOSString());
String chosenFile = dialog.open();
if (chosenFile != null) {
inputCommand.insert(chosenFile);
}
} }
}); });
} }

View file

@ -205,7 +205,7 @@ public final class GCCBuildCommandParserOptionPage extends AbstractLanguageSetti
{ {
scopeFolderRadioButton = new Button(resourceScopeGroup, SWT.RADIO); scopeFolderRadioButton = new Button(resourceScopeGroup, SWT.RADIO);
scopeFolderRadioButton.setText("Per folder, use when settings are the same for all files in a folder"); scopeFolderRadioButton.setText("Per folder, use when settings are the same for all files in each folder");
// applyToEnclosingFolderRadioButton.setText("Enclosing folder, use when settings are the same for all files in a folder"); // applyToEnclosingFolderRadioButton.setText("Enclosing folder, use when settings are the same for all files in a folder");
GridData gd = new GridData(GridData.FILL_HORIZONTAL); GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2; gd.horizontalSpan = 2;

View file

@ -575,7 +575,7 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab {
boolean isAllowedEditing = provider instanceof ILanguageSettingsEditableProvider boolean isAllowedEditing = provider instanceof ILanguageSettingsEditableProvider
&& LanguageSettingsProviderAssociationManager.isAllowedToEditEntries(provider); && LanguageSettingsProviderAssociationManager.isAllowedToEditEntries(provider);
if (!isAllowedEditing) { if (!isAllowedEditing) {
String msg = "Setting entries for this provider are supplied by system and are not editable."; String msg = "Setting entries for this provider are supplied by the system and are not editable.";
status = new Status(IStatus.INFO, CUIPlugin.PLUGIN_ID, msg); status = new Status(IStatus.INFO, CUIPlugin.PLUGIN_ID, msg);
} }
} }