mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 18:05:33 +02:00
Clean up
This commit is contained in:
parent
ab036f4bfc
commit
2212f5ce33
17 changed files with 340 additions and 375 deletions
|
@ -61,6 +61,10 @@ public class Messages extends NLS {
|
||||||
public static String BuildToolSettingsPage_tool_advancedSettings;
|
public static String BuildToolSettingsPage_tool_advancedSettings;
|
||||||
public static String BuildToolSettingsPage_tool_command;
|
public static String BuildToolSettingsPage_tool_command;
|
||||||
public static String BuildToolSettingsPage_tool_commandLinePattern;
|
public static String BuildToolSettingsPage_tool_commandLinePattern;
|
||||||
|
public static String BuiltinSpecsDetectorOptionPage_AllocateConsole;
|
||||||
|
public static String BuiltinSpecsDetectorOptionPage_Browse;
|
||||||
|
public static String BuiltinSpecsDetectorOptionPage_ChooseFile;
|
||||||
|
public static String BuiltinSpecsDetectorOptionPage_CompilerSpecsCommand;
|
||||||
public static String CConfigWizardPage_0;
|
public static String CConfigWizardPage_0;
|
||||||
public static String CConfigWizardPage_1;
|
public static String CConfigWizardPage_1;
|
||||||
public static String CConfigWizardPage_10;
|
public static String CConfigWizardPage_10;
|
||||||
|
@ -105,6 +109,12 @@ public class Messages extends NLS {
|
||||||
public static String DiscoveryTab_ErrorClearingEntries;
|
public static String DiscoveryTab_ErrorClearingEntries;
|
||||||
public static String EnvironmentTab_15;
|
public static String EnvironmentTab_15;
|
||||||
public static String EnvironmentTab_23;
|
public static String EnvironmentTab_23;
|
||||||
|
public static String GCCBuildCommandParserOptionPage_CompilerPattern;
|
||||||
|
public static String GCCBuildCommandParserOptionPage_ContainerForDiscoveredEntries;
|
||||||
|
public static String GCCBuildCommandParserOptionPage_File;
|
||||||
|
public static String GCCBuildCommandParserOptionPage_Folder;
|
||||||
|
public static String GCCBuildCommandParserOptionPage_Project;
|
||||||
|
public static String GCCBuildCommandParserOptionPage_ResolvePaths;
|
||||||
public static String MacrosBlock_label_delete_all_confirm_message;
|
public static String MacrosBlock_label_delete_all_confirm_message;
|
||||||
public static String MacrosBlock_label_delete_all_confirm_title;
|
public static String MacrosBlock_label_delete_all_confirm_title;
|
||||||
public static String MacrosBlock_label_delete_confirm_message;
|
public static String MacrosBlock_label_delete_confirm_message;
|
||||||
|
|
|
@ -304,3 +304,15 @@ NewCfgDialog_5=Import predefined
|
||||||
|
|
||||||
ToolChainSelectionPage_Description=Select the initial toolchain for this project.
|
ToolChainSelectionPage_Description=Select the initial toolchain for this project.
|
||||||
ToolChainSelectionPage_Title=Select Tool Chain
|
ToolChainSelectionPage_Title=Select Tool Chain
|
||||||
|
|
||||||
|
# Language Settings Providers
|
||||||
|
BuiltinSpecsDetectorOptionPage_AllocateConsole=Allocate console in the Console View
|
||||||
|
BuiltinSpecsDetectorOptionPage_Browse=Browse...
|
||||||
|
BuiltinSpecsDetectorOptionPage_ChooseFile=Choose file
|
||||||
|
BuiltinSpecsDetectorOptionPage_CompilerSpecsCommand=Command to get compiler specs:
|
||||||
|
GCCBuildCommandParserOptionPage_CompilerPattern=Compiler command pattern:
|
||||||
|
GCCBuildCommandParserOptionPage_ContainerForDiscoveredEntries=Container to keep discovered entries
|
||||||
|
GCCBuildCommandParserOptionPage_File=File (use when settings vary for different files)
|
||||||
|
GCCBuildCommandParserOptionPage_Folder=Folder (use when settings are the same for all files in each folder)
|
||||||
|
GCCBuildCommandParserOptionPage_Project=Project (use when settings are the same for all files in the project)
|
||||||
|
GCCBuildCommandParserOptionPage_ResolvePaths=Use heuristics to resolve paths
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2009, 2010 Andrew Gvozdev and others.
|
* Copyright (c) 2009, 2012 Andrew Gvozdev and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,15 +8,13 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Gvozdev - Initial API and implementation
|
* Andrew Gvozdev - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
|
package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||||
import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector;
|
import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector;
|
||||||
import org.eclipse.cdt.ui.language.settings.providers.AbstractLanguageSettingProviderOptionPage;
|
import org.eclipse.cdt.ui.language.settings.providers.AbstractLanguageSettingProviderOptionPage;
|
||||||
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
|
||||||
import org.eclipse.core.runtime.Path;
|
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;
|
||||||
|
@ -37,122 +35,121 @@ import org.eclipse.swt.widgets.Text;
|
||||||
*/
|
*/
|
||||||
public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettingProviderOptionPage {
|
public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettingProviderOptionPage {
|
||||||
private boolean fEditable;
|
private boolean fEditable;
|
||||||
|
|
||||||
private Text inputCommand;
|
private Text inputCommand;
|
||||||
|
|
||||||
private Button allocateConsoleCheckBox;
|
private Button allocateConsoleCheckBox;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createControl(Composite parent) {
|
public void createControl(Composite parent) {
|
||||||
fEditable = parent.isEnabled();
|
fEditable = parent.isEnabled();
|
||||||
|
|
||||||
Composite composite = new Composite(parent, SWT.NONE);
|
|
||||||
{
|
|
||||||
GridLayout layout = new GridLayout();
|
|
||||||
layout.numColumns = 2;
|
|
||||||
layout.marginWidth = 1;
|
|
||||||
layout.marginHeight = 1;
|
|
||||||
layout.marginRight = 1;
|
|
||||||
composite.setLayout(layout);
|
|
||||||
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
|
|
||||||
Dialog.applyDialogFont(composite);
|
|
||||||
|
|
||||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
|
||||||
gd.horizontalSpan = 2;
|
|
||||||
composite.setLayoutData(gd);
|
|
||||||
}
|
|
||||||
|
|
||||||
AbstractBuiltinSpecsDetector provider = (AbstractBuiltinSpecsDetector) getProvider();
|
AbstractBuiltinSpecsDetector provider = (AbstractBuiltinSpecsDetector) getProvider();
|
||||||
|
|
||||||
// Compiler specs command
|
Composite composite = createCompositeForPageArea(parent);
|
||||||
{
|
createCompilerCommandInputControl(composite, provider);
|
||||||
Label label = ControlFactory.createLabel(composite, "Command to get compiler specs:");
|
createBrowseButton(composite);
|
||||||
GridData gd = new GridData();
|
createConsoleCheckbox(composite, provider);
|
||||||
gd.horizontalSpan = 2;
|
|
||||||
label.setLayoutData(gd);
|
|
||||||
label.setEnabled(fEditable);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
inputCommand = ControlFactory.createTextField(composite, SWT.SINGLE | SWT.BORDER);
|
|
||||||
String command = provider.getCommand();
|
|
||||||
inputCommand.setText(command!=null ? command : "");
|
|
||||||
inputCommand.setEnabled(fEditable);
|
|
||||||
inputCommand.addModifyListener(new ModifyListener() {
|
|
||||||
@Override
|
|
||||||
public void modifyText(ModifyEvent e) {
|
|
||||||
String text = inputCommand.getText();
|
|
||||||
AbstractBuiltinSpecsDetector provider = (AbstractBuiltinSpecsDetector) getProvider();
|
|
||||||
if (!text.equals(provider.getCommand())) {
|
|
||||||
AbstractBuiltinSpecsDetector selectedProvider = (AbstractBuiltinSpecsDetector) getProviderWorkingCopy();
|
|
||||||
selectedProvider.setCommand(text);
|
|
||||||
refreshItem(selectedProvider);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
Button button = ControlFactory.createPushButton(composite, "Browse...");
|
|
||||||
button.setEnabled(fEditable);
|
|
||||||
button.addSelectionListener(new SelectionAdapter() {
|
|
||||||
@Override
|
|
||||||
public void widgetSelected(SelectionEvent evt) {
|
|
||||||
FileDialog dialog = new FileDialog(getShell(), SWT.NONE);
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
allocateConsoleCheckBox = new Button(composite, SWT.CHECK);
|
|
||||||
allocateConsoleCheckBox.setText("Allocate console in the Console View");
|
|
||||||
allocateConsoleCheckBox.setSelection(provider.isConsoleEnabled());
|
|
||||||
allocateConsoleCheckBox.setEnabled(fEditable);
|
|
||||||
allocateConsoleCheckBox.addSelectionListener(new SelectionAdapter() {
|
|
||||||
@Override
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
|
||||||
boolean enabled = allocateConsoleCheckBox.getSelection();
|
|
||||||
AbstractBuiltinSpecsDetector provider = (AbstractBuiltinSpecsDetector) getProvider();
|
|
||||||
if (enabled != provider.isConsoleEnabled()) {
|
|
||||||
AbstractBuiltinSpecsDetector selectedProvider = (AbstractBuiltinSpecsDetector) getProviderWorkingCopy();
|
|
||||||
selectedProvider.setConsoleEnabled(enabled);
|
|
||||||
refreshItem(selectedProvider);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void widgetDefaultSelected(SelectionEvent e) {
|
|
||||||
widgetSelected(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
setControl(composite);
|
setControl(composite);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public void performApply(IProgressMonitor monitor) throws CoreException {
|
* Create composite for the page.
|
||||||
// handled by LanguageSettingsProviderTab
|
*/
|
||||||
|
private Composite createCompositeForPageArea(Composite parent) {
|
||||||
|
Composite composite = new Composite(parent, SWT.NONE);
|
||||||
|
GridLayout layout = new GridLayout();
|
||||||
|
layout.numColumns = 2;
|
||||||
|
layout.marginWidth = 1;
|
||||||
|
layout.marginHeight = 1;
|
||||||
|
layout.marginRight = 1;
|
||||||
|
composite.setLayout(layout);
|
||||||
|
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||||
|
Dialog.applyDialogFont(composite);
|
||||||
|
|
||||||
|
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||||
|
gd.horizontalSpan = 2;
|
||||||
|
composite.setLayoutData(gd);
|
||||||
|
return composite;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public void performDefaults() {
|
* Create input control for compiler command.
|
||||||
// handled by LanguageSettingsProviderTab
|
*/
|
||||||
|
private void createCompilerCommandInputControl(Composite composite, AbstractBuiltinSpecsDetector provider) {
|
||||||
|
Label label = ControlFactory.createLabel(composite, Messages.BuiltinSpecsDetectorOptionPage_CompilerSpecsCommand);
|
||||||
|
GridData gd = new GridData();
|
||||||
|
gd.horizontalSpan = 2;
|
||||||
|
label.setLayoutData(gd);
|
||||||
|
label.setEnabled(fEditable);
|
||||||
|
|
||||||
|
inputCommand = ControlFactory.createTextField(composite, SWT.SINGLE | SWT.BORDER);
|
||||||
|
String command = provider.getCommand();
|
||||||
|
inputCommand.setText(command!=null ? command : ""); //$NON-NLS-1$
|
||||||
|
inputCommand.setEnabled(fEditable);
|
||||||
|
inputCommand.addModifyListener(new ModifyListener() {
|
||||||
|
@Override
|
||||||
|
public void modifyText(ModifyEvent e) {
|
||||||
|
String text = inputCommand.getText();
|
||||||
|
AbstractBuiltinSpecsDetector provider = (AbstractBuiltinSpecsDetector) getProvider();
|
||||||
|
if (!text.equals(provider.getCommand())) {
|
||||||
|
AbstractBuiltinSpecsDetector selectedProvider = (AbstractBuiltinSpecsDetector) getProviderWorkingCopy();
|
||||||
|
selectedProvider.setCommand(text);
|
||||||
|
refreshItem(selectedProvider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create "Browse" button.
|
||||||
|
*/
|
||||||
|
private void createBrowseButton(Composite composite) {
|
||||||
|
Button button = ControlFactory.createPushButton(composite, Messages.BuiltinSpecsDetectorOptionPage_Browse);
|
||||||
|
button.setEnabled(fEditable);
|
||||||
|
button.addSelectionListener(new SelectionAdapter() {
|
||||||
|
@Override
|
||||||
|
public void widgetSelected(SelectionEvent evt) {
|
||||||
|
FileDialog dialog = new FileDialog(getShell(), SWT.NONE);
|
||||||
|
dialog.setText(Messages.BuiltinSpecsDetectorOptionPage_ChooseFile);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create check-box for console.
|
||||||
|
*/
|
||||||
|
private void createConsoleCheckbox(Composite composite, AbstractBuiltinSpecsDetector provider) {
|
||||||
|
allocateConsoleCheckBox = new Button(composite, SWT.CHECK);
|
||||||
|
allocateConsoleCheckBox.setText(Messages.BuiltinSpecsDetectorOptionPage_AllocateConsole);
|
||||||
|
allocateConsoleCheckBox.setSelection(provider.isConsoleEnabled());
|
||||||
|
allocateConsoleCheckBox.setEnabled(fEditable);
|
||||||
|
allocateConsoleCheckBox.addSelectionListener(new SelectionAdapter() {
|
||||||
|
@Override
|
||||||
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
boolean enabled = allocateConsoleCheckBox.getSelection();
|
||||||
|
AbstractBuiltinSpecsDetector provider = (AbstractBuiltinSpecsDetector) getProvider();
|
||||||
|
if (enabled != provider.isConsoleEnabled()) {
|
||||||
|
AbstractBuiltinSpecsDetector selectedProvider = (AbstractBuiltinSpecsDetector) getProviderWorkingCopy();
|
||||||
|
selectedProvider.setConsoleEnabled(enabled);
|
||||||
|
refreshItem(selectedProvider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void widgetDefaultSelected(SelectionEvent e) {
|
||||||
|
widgetSelected(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2009, 2010 Andrew Gvozdev and others.
|
* Copyright (c) 2009, 2012 Andrew Gvozdev and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,14 +8,12 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Gvozdev - Initial API and implementation
|
* Andrew Gvozdev - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
|
package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||||
import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuildCommandParser;
|
import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuildCommandParser;
|
||||||
import org.eclipse.cdt.ui.language.settings.providers.AbstractLanguageSettingProviderOptionPage;
|
import org.eclipse.cdt.ui.language.settings.providers.AbstractLanguageSettingProviderOptionPage;
|
||||||
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
|
||||||
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;
|
||||||
|
@ -31,26 +29,37 @@ import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Options page for TODO
|
* Options page for {@link AbstractBuildCommandParser}.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class GCCBuildCommandParserOptionPage extends AbstractLanguageSettingProviderOptionPage {
|
public final class GCCBuildCommandParserOptionPage extends AbstractLanguageSettingProviderOptionPage {
|
||||||
private boolean fEditable;
|
private boolean fEditable;
|
||||||
|
|
||||||
private Text inputCommand;
|
private Text inputCommand;
|
||||||
|
|
||||||
private Button expandRelativePathCheckBox;
|
private Button expandRelativePathCheckBox;
|
||||||
|
|
||||||
private Button scopeProjectRadioButton;
|
private Button scopeProjectRadioButton;
|
||||||
private Button scopeFolderRadioButton;
|
private Button scopeFolderRadioButton;
|
||||||
private Button scopeFileRadioButton;
|
private Button scopeFileRadioButton;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createControl(Composite parent) {
|
public void createControl(Composite parent) {
|
||||||
fEditable = parent.isEnabled();
|
fEditable = parent.isEnabled();
|
||||||
|
AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
|
||||||
|
|
||||||
final Composite composite = new Composite(parent, SWT.NONE);
|
Composite composite = new Composite(parent, SWT.NONE);
|
||||||
|
createCompositeForPageArea(composite);
|
||||||
|
createCompilerPatternInputControl(provider, composite);
|
||||||
|
createResourceScopeGroup(provider, composite);
|
||||||
|
createResolvePathsCheckbox(composite, provider);
|
||||||
|
|
||||||
|
setControl(composite);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create composite for the page.
|
||||||
|
*/
|
||||||
|
private void createCompositeForPageArea(final Composite composite) {
|
||||||
{
|
{
|
||||||
GridLayout layout = new GridLayout();
|
GridLayout layout = new GridLayout();
|
||||||
layout.numColumns = 2;
|
layout.numColumns = 2;
|
||||||
|
@ -65,189 +74,158 @@ public final class GCCBuildCommandParserOptionPage extends AbstractLanguageSetti
|
||||||
gd.horizontalSpan = 2;
|
gd.horizontalSpan = 2;
|
||||||
composite.setLayoutData(gd);
|
composite.setLayoutData(gd);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
|
/**
|
||||||
|
* Create input control for compiler pattern.
|
||||||
|
*/
|
||||||
|
private void createCompilerPatternInputControl(AbstractBuildCommandParser provider, Composite composite) {
|
||||||
|
Label label = ControlFactory.createLabel(composite, Messages.GCCBuildCommandParserOptionPage_CompilerPattern);
|
||||||
|
GridData gd = new GridData();
|
||||||
|
gd.horizontalSpan = 1;
|
||||||
|
label.setLayoutData(gd);
|
||||||
|
label.setEnabled(fEditable);
|
||||||
|
|
||||||
// Compiler specs command
|
inputCommand = ControlFactory.createTextField(composite, SWT.SINGLE | SWT.BORDER);
|
||||||
{
|
String compilerPattern = provider.getCompilerPattern();
|
||||||
Label label = ControlFactory.createLabel(composite, "Compiler command pattern:");
|
inputCommand.setText(compilerPattern!=null ? compilerPattern : ""); //$NON-NLS-1$
|
||||||
GridData gd = new GridData();
|
|
||||||
gd.horizontalSpan = 1;
|
|
||||||
label.setLayoutData(gd);
|
|
||||||
label.setEnabled(fEditable);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
gd = new GridData();
|
||||||
inputCommand = ControlFactory.createTextField(composite, SWT.SINGLE | SWT.BORDER);
|
gd.horizontalSpan = 1;
|
||||||
String compilerPattern = provider.getCompilerPattern();
|
gd.grabExcessHorizontalSpace = true;
|
||||||
inputCommand.setText(compilerPattern!=null ? compilerPattern : "");
|
gd.horizontalAlignment = SWT.FILL;
|
||||||
|
inputCommand.setLayoutData(gd);
|
||||||
|
inputCommand.setEnabled(fEditable);
|
||||||
|
|
||||||
GridData gd = new GridData();
|
inputCommand.addModifyListener(new ModifyListener() {
|
||||||
gd.horizontalSpan = 1;
|
@Override
|
||||||
gd.grabExcessHorizontalSpace = true;
|
public void modifyText(ModifyEvent e) {
|
||||||
gd.horizontalAlignment = SWT.FILL;
|
String text = inputCommand.getText();
|
||||||
inputCommand.setLayoutData(gd);
|
AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
|
||||||
inputCommand.setEnabled(fEditable);
|
if (!text.equals(provider.getCompilerPattern())) {
|
||||||
|
AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
|
||||||
inputCommand.addModifyListener(new ModifyListener() {
|
selectedProvider.setCompilerPattern(text);
|
||||||
@Override
|
refreshItem(selectedProvider);
|
||||||
public void modifyText(ModifyEvent e) {
|
|
||||||
String text = inputCommand.getText();
|
|
||||||
AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
|
|
||||||
if (!text.equals(provider.getCompilerPattern())) {
|
|
||||||
AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
|
|
||||||
selectedProvider.setCompilerPattern(text);
|
|
||||||
refreshItem(selectedProvider);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
|
||||||
{
|
/**
|
||||||
expandRelativePathCheckBox = new Button(composite, SWT.CHECK);
|
* Create check-box for resolving paths.
|
||||||
expandRelativePathCheckBox.setText("Use heuristics to resolve paths");
|
*/
|
||||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
private void createResolvePathsCheckbox(Composite composite, AbstractBuildCommandParser provider) {
|
||||||
gd.horizontalSpan = 2;
|
expandRelativePathCheckBox = new Button(composite, SWT.CHECK);
|
||||||
expandRelativePathCheckBox.setLayoutData(gd);
|
expandRelativePathCheckBox.setText(Messages.GCCBuildCommandParserOptionPage_ResolvePaths);
|
||||||
|
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||||
|
gd.horizontalSpan = 2;
|
||||||
|
expandRelativePathCheckBox.setLayoutData(gd);
|
||||||
|
|
||||||
expandRelativePathCheckBox.setSelection(provider.isResolvingPaths());
|
expandRelativePathCheckBox.setSelection(provider.isResolvingPaths());
|
||||||
expandRelativePathCheckBox.setEnabled(fEditable);
|
expandRelativePathCheckBox.setEnabled(fEditable);
|
||||||
expandRelativePathCheckBox.addSelectionListener(new SelectionAdapter() {
|
expandRelativePathCheckBox.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
boolean enabled = expandRelativePathCheckBox.getSelection();
|
boolean enabled = expandRelativePathCheckBox.getSelection();
|
||||||
AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
|
AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
|
||||||
if (enabled != provider.isResolvingPaths()) {
|
if (enabled != provider.isResolvingPaths()) {
|
||||||
AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
|
AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
|
||||||
selectedProvider.setResolvingPaths(enabled);
|
selectedProvider.setResolvingPaths(enabled);
|
||||||
refreshItem(selectedProvider);
|
refreshItem(selectedProvider);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void widgetDefaultSelected(SelectionEvent e) {
|
||||||
|
widgetSelected(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public void widgetDefaultSelected(SelectionEvent e) {
|
* Create group and radio buttons for container to keep discovered entries.
|
||||||
widgetSelected(e);
|
*/
|
||||||
}
|
private void createResourceScopeGroup(AbstractBuildCommandParser provider, Composite composite) {
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Group resourceScopeGroup = new Group(composite, SWT.NONE);
|
Group resourceScopeGroup = new Group(composite, SWT.NONE);
|
||||||
{
|
resourceScopeGroup.setText(Messages.GCCBuildCommandParserOptionPage_ContainerForDiscoveredEntries);
|
||||||
// resourceScopeGroup.setText("Define scope of discovered entries");
|
resourceScopeGroup.setLayout(new GridLayout(2, false));
|
||||||
// resourceScopeGroup.setText("Apply discovered entries to");
|
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||||
resourceScopeGroup.setText("Scope to keep discovered entries");
|
gd.horizontalSpan = 2;
|
||||||
resourceScopeGroup.setLayout(new GridLayout(2, false));
|
resourceScopeGroup.setLayoutData(gd);
|
||||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
|
||||||
gd.horizontalSpan = 2;
|
|
||||||
resourceScopeGroup.setLayoutData(gd);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
scopeFileRadioButton = new Button(resourceScopeGroup, SWT.RADIO);
|
||||||
scopeFileRadioButton = new Button(resourceScopeGroup, SWT.RADIO);
|
scopeFileRadioButton.setText(Messages.GCCBuildCommandParserOptionPage_File);
|
||||||
scopeFileRadioButton.setText("Per file, use when settings vary for different files");
|
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||||
// applyToResourceRadioButton.setText("File level, use when settings vary for different files");
|
gd.horizontalSpan = 2;
|
||||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
scopeFileRadioButton.setLayoutData(gd);
|
||||||
gd.horizontalSpan = 2;
|
|
||||||
scopeFileRadioButton.setLayoutData(gd);
|
|
||||||
|
|
||||||
scopeFileRadioButton.setSelection(provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.FILE);
|
scopeFileRadioButton.setSelection(provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.FILE);
|
||||||
scopeFileRadioButton.setEnabled(fEditable);
|
scopeFileRadioButton.setEnabled(fEditable);
|
||||||
scopeFileRadioButton.addSelectionListener(new SelectionAdapter() {
|
scopeFileRadioButton.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
boolean enabled = scopeFileRadioButton.getSelection();
|
boolean enabled = scopeFileRadioButton.getSelection();
|
||||||
AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
|
AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
|
||||||
if (enabled != (provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.FILE)) {
|
if (enabled != (provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.FILE)) {
|
||||||
AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
|
AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
|
||||||
selectedProvider.setResourceScope(AbstractBuildCommandParser.ResourceScope.FILE);
|
selectedProvider.setResourceScope(AbstractBuildCommandParser.ResourceScope.FILE);
|
||||||
refreshItem(selectedProvider);
|
refreshItem(selectedProvider);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void widgetDefaultSelected(SelectionEvent e) {
|
||||||
|
widgetSelected(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
@Override
|
scopeFolderRadioButton = new Button(resourceScopeGroup, SWT.RADIO);
|
||||||
public void widgetDefaultSelected(SelectionEvent e) {
|
scopeFolderRadioButton.setText(Messages.GCCBuildCommandParserOptionPage_Folder);
|
||||||
widgetSelected(e);
|
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||||
|
gd.horizontalSpan = 2;
|
||||||
|
scopeFolderRadioButton.setLayoutData(gd);
|
||||||
|
|
||||||
|
scopeFolderRadioButton.setSelection(provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.FOLDER);
|
||||||
|
scopeFolderRadioButton.setEnabled(fEditable);
|
||||||
|
scopeFolderRadioButton.addSelectionListener(new SelectionAdapter() {
|
||||||
|
@Override
|
||||||
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
boolean enabled = scopeFolderRadioButton.getSelection();
|
||||||
|
AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
|
||||||
|
if (enabled != (provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.FOLDER)) {
|
||||||
|
AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
|
||||||
|
selectedProvider.setResourceScope(AbstractBuildCommandParser.ResourceScope.FOLDER);
|
||||||
|
refreshItem(selectedProvider);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void widgetDefaultSelected(SelectionEvent e) {
|
||||||
|
widgetSelected(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
scopeProjectRadioButton = new Button(resourceScopeGroup, SWT.RADIO);
|
||||||
|
scopeProjectRadioButton.setText(Messages.GCCBuildCommandParserOptionPage_Project);
|
||||||
|
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||||
|
gd.horizontalSpan = 2;
|
||||||
|
scopeProjectRadioButton.setLayoutData(gd);
|
||||||
|
|
||||||
}
|
scopeProjectRadioButton.setSelection(provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.PROJECT);
|
||||||
|
scopeProjectRadioButton.setEnabled(fEditable);
|
||||||
{
|
scopeProjectRadioButton.addSelectionListener(new SelectionAdapter() {
|
||||||
scopeFolderRadioButton = new Button(resourceScopeGroup, SWT.RADIO);
|
@Override
|
||||||
scopeFolderRadioButton.setText("Per folder, use when settings are the same for all files in each folder");
|
public void widgetSelected(SelectionEvent e) {
|
||||||
// applyToEnclosingFolderRadioButton.setText("Enclosing folder, use when settings are the same for all files in a folder");
|
boolean enabled = scopeProjectRadioButton.getSelection();
|
||||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
|
||||||
gd.horizontalSpan = 2;
|
if (enabled != (provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.PROJECT)) {
|
||||||
scopeFolderRadioButton.setLayoutData(gd);
|
AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
|
||||||
|
selectedProvider.setResourceScope(AbstractBuildCommandParser.ResourceScope.PROJECT);
|
||||||
scopeFolderRadioButton.setSelection(provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.FOLDER);
|
refreshItem(selectedProvider);
|
||||||
scopeFolderRadioButton.setEnabled(fEditable);
|
|
||||||
scopeFolderRadioButton.addSelectionListener(new SelectionAdapter() {
|
|
||||||
@Override
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
|
||||||
boolean enabled = scopeFolderRadioButton.getSelection();
|
|
||||||
AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
|
|
||||||
if (enabled != (provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.FOLDER)) {
|
|
||||||
AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
|
|
||||||
selectedProvider.setResourceScope(AbstractBuildCommandParser.ResourceScope.FOLDER);
|
|
||||||
refreshItem(selectedProvider);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void widgetDefaultSelected(SelectionEvent e) {
|
public void widgetDefaultSelected(SelectionEvent e) {
|
||||||
widgetSelected(e);
|
widgetSelected(e);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
scopeProjectRadioButton = new Button(resourceScopeGroup, SWT.RADIO);
|
|
||||||
scopeProjectRadioButton.setText("Per project, use when settings are the same for all files in the project");
|
|
||||||
// applyToProjectRadioButton.setText("Project level, use when settings are the same for all files in the project");
|
|
||||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
|
||||||
gd.horizontalSpan = 2;
|
|
||||||
scopeProjectRadioButton.setLayoutData(gd);
|
|
||||||
|
|
||||||
scopeProjectRadioButton.setSelection(provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.PROJECT);
|
|
||||||
scopeProjectRadioButton.setEnabled(fEditable);
|
|
||||||
scopeProjectRadioButton.addSelectionListener(new SelectionAdapter() {
|
|
||||||
@Override
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
|
||||||
boolean enabled = scopeProjectRadioButton.getSelection();
|
|
||||||
AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
|
|
||||||
if (enabled != (provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.PROJECT)) {
|
|
||||||
AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
|
|
||||||
selectedProvider.setResourceScope(AbstractBuildCommandParser.ResourceScope.PROJECT);
|
|
||||||
refreshItem(selectedProvider);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void widgetDefaultSelected(SelectionEvent e) {
|
|
||||||
widgetSelected(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
setControl(composite);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void performApply(IProgressMonitor monitor) throws CoreException {
|
|
||||||
// handled by LanguageSettingsProviderTab
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void performDefaults() {
|
|
||||||
// handled by LanguageSettingsProviderTab
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2010, 2011 Andrew Gvozdev and others.
|
* Copyright (c) 2010, 2012 Andrew Gvozdev and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,16 +8,18 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Gvozdev - Initial API and implementation
|
* Andrew Gvozdev - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
|
package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.buildconsole.CBuildConsole;
|
import org.eclipse.cdt.internal.ui.buildconsole.CBuildConsole;
|
||||||
|
import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector;
|
||||||
import org.eclipse.cdt.ui.language.settings.providers.LanguageSettingsProvidersImages;
|
import org.eclipse.cdt.ui.language.settings.providers.LanguageSettingsProvidersImages;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Console adapter for {@link AbstractBuiltinSpecsDetector}.
|
||||||
|
*/
|
||||||
public class ScannerDiscoveryConsole extends CBuildConsole {
|
public class ScannerDiscoveryConsole extends CBuildConsole {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
* @param consoleId - a console ID is expected here which then is used as menu context ID.
|
* @param consoleId - a console ID is expected here which then is used as menu context ID.
|
||||||
|
@ -28,12 +30,10 @@ public class ScannerDiscoveryConsole extends CBuildConsole {
|
||||||
@Override
|
@Override
|
||||||
public void init(String consoleId, String name, URL defaultIconUrl) {
|
public void init(String consoleId, String name, URL defaultIconUrl) {
|
||||||
URL iconUrl = LanguageSettingsProvidersImages.getImageUrl(consoleId);
|
URL iconUrl = LanguageSettingsProvidersImages.getImageUrl(consoleId);
|
||||||
if (iconUrl==null) {
|
if (iconUrl == null) {
|
||||||
iconUrl = defaultIconUrl;
|
iconUrl = defaultIconUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
super.init(consoleId, name, iconUrl);
|
super.init(consoleId, name, iconUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2011, 2011 Andrew Gvozdev and others.
|
* Copyright (c) 2011, 2012 Andrew Gvozdev and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Gvozdev - Initial API and implementation
|
* Andrew Gvozdev - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
|
package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -16,6 +15,7 @@ import java.net.URL;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.ConsoleOutputStream;
|
import org.eclipse.cdt.core.ConsoleOutputStream;
|
||||||
import org.eclipse.cdt.internal.core.ICConsole;
|
import org.eclipse.cdt.internal.core.ICConsole;
|
||||||
|
import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector;
|
||||||
import org.eclipse.cdt.ui.CDTSharedImages;
|
import org.eclipse.cdt.ui.CDTSharedImages;
|
||||||
import org.eclipse.cdt.ui.language.settings.providers.LanguageSettingsProvidersImages;
|
import org.eclipse.cdt.ui.language.settings.providers.LanguageSettingsProvidersImages;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
@ -29,22 +29,17 @@ import org.eclipse.ui.console.MessageConsole;
|
||||||
import org.eclipse.ui.console.MessageConsoleStream;
|
import org.eclipse.ui.console.MessageConsoleStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO
|
* Console adapter for global {@link AbstractBuiltinSpecsDetector}.
|
||||||
*
|
*
|
||||||
* Note that this console is not colored.
|
* Note that this console is not colored.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class ScannerDiscoveryGlobalConsole implements ICConsole {
|
public class ScannerDiscoveryGlobalConsole implements ICConsole {
|
||||||
private MessageConsole console;
|
private MessageConsole console;
|
||||||
private ConsoleOutputStreamAdapter stream;
|
|
||||||
|
|
||||||
private class ConsoleOutputStreamAdapter extends ConsoleOutputStream {
|
private class ConsoleOutputStreamAdapter extends ConsoleOutputStream {
|
||||||
private MessageConsoleStream fConsoleStream;
|
private MessageConsoleStream fConsoleStream;
|
||||||
private boolean isOpen;
|
|
||||||
|
|
||||||
public ConsoleOutputStreamAdapter(MessageConsoleStream stream) {
|
public ConsoleOutputStreamAdapter(MessageConsoleStream stream) {
|
||||||
fConsoleStream = stream;
|
fConsoleStream = stream;
|
||||||
isOpen = true;
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void write(int arg0) throws IOException {
|
public void write(int arg0) throws IOException {
|
||||||
|
@ -63,7 +58,6 @@ public class ScannerDiscoveryGlobalConsole implements ICConsole {
|
||||||
@Override
|
@Override
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
fConsoleStream.close();
|
fConsoleStream.close();
|
||||||
isOpen = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,8 +112,6 @@ public class ScannerDiscoveryGlobalConsole implements ICConsole {
|
||||||
console.activate();
|
console.activate();
|
||||||
consoleManager.addConsoles(new IConsole[]{ console });
|
consoleManager.addConsoles(new IConsole[]{ console });
|
||||||
}
|
}
|
||||||
|
|
||||||
// stream = new ConsoleOutputStreamAdapter(console.newMessageStream());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
package org.eclipse.cdt.managedbuilder.ui.preferences;
|
package org.eclipse.cdt.managedbuilder.ui.preferences;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||||
|
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||||
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
|
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
|
||||||
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||||
|
@ -122,7 +123,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
||||||
show_mng.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOMNG));
|
show_mng.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOMNG));
|
||||||
show_tool.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOTOOLM));
|
show_tool.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOTOOLM));
|
||||||
show_exp.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_EXPORT));
|
show_exp.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_EXPORT));
|
||||||
show_providers_tab.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NO_SHOW_PROVIDERS));
|
show_providers_tab.setSelection(!CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS));
|
||||||
show_tipbox.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_TIPBOX));
|
show_tipbox.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_TIPBOX));
|
||||||
|
|
||||||
switch (CDTPrefUtil.getInt(CDTPrefUtil.KEY_DISC_NAMES)) {
|
switch (CDTPrefUtil.getInt(CDTPrefUtil.KEY_DISC_NAMES)) {
|
||||||
|
@ -146,7 +147,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOMNG, !show_mng.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOMNG, !show_mng.getSelection());
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOTOOLM, !show_tool.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOTOOLM, !show_tool.getSelection());
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_EXPORT, show_exp.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_EXPORT, show_exp.getSelection());
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NO_SHOW_PROVIDERS, !show_providers_tab.getSelection());
|
CDTPrefUtil.setBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS, !show_providers_tab.getSelection());
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_TIPBOX, show_tipbox.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_TIPBOX, show_tipbox.getSelection());
|
||||||
int x = 0;
|
int x = 0;
|
||||||
if (b_1.getSelection()) x = 1;
|
if (b_1.getSelection()) x = 1;
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
package org.eclipse.cdt.managedbuilder.ui.preferences;
|
package org.eclipse.cdt.managedbuilder.ui.preferences;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||||
|
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||||
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
|
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
|
||||||
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||||
|
@ -22,7 +23,7 @@ import org.eclipse.swt.widgets.Composite;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*
|
*
|
||||||
* @noextend This class is not intended to be subclassed by clients.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
* @noinstantiate This class is not intended to be instantiated by clients.
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
*/
|
*/
|
||||||
|
@ -38,11 +39,11 @@ public class WizardDefaultsTab extends AbstractCPropertyTab {
|
||||||
usercomp.setLayout(new GridLayout(1, false));
|
usercomp.setLayout(new GridLayout(1, false));
|
||||||
|
|
||||||
show_sup = new Button(usercomp, SWT.CHECK);
|
show_sup = new Button(usercomp, SWT.CHECK);
|
||||||
show_sup.setText(Messages.WizardDefaultsTab_0);
|
show_sup.setText(Messages.WizardDefaultsTab_0);
|
||||||
show_sup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
show_sup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
|
||||||
show_oth = new Button(usercomp, SWT.CHECK);
|
show_oth = new Button(usercomp, SWT.CHECK);
|
||||||
show_oth.setText(Messages.WizardDefaultsTab_1);
|
show_oth.setText(Messages.WizardDefaultsTab_1);
|
||||||
show_oth.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
show_oth.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
|
||||||
checkBoxTryNewSD = new Button(usercomp, SWT.CHECK);
|
checkBoxTryNewSD = new Button(usercomp, SWT.CHECK);
|
||||||
|
@ -51,16 +52,16 @@ public class WizardDefaultsTab extends AbstractCPropertyTab {
|
||||||
|
|
||||||
show_sup.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOSUPP));
|
show_sup.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOSUPP));
|
||||||
show_oth.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_OTHERS));
|
show_oth.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_OTHERS));
|
||||||
checkBoxTryNewSD.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_NEWSD));
|
checkBoxTryNewSD.setSelection(CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NEWSD));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void performOK() {
|
protected void performOK() {
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOSUPP, !show_sup.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOSUPP, !show_sup.getSelection());
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_OTHERS, show_oth.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_OTHERS, show_oth.getSelection());
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NEWSD, checkBoxTryNewSD.getSelection());
|
CDTPrefUtil.setBool(LanguageSettingsProvidersPage.KEY_NEWSD, checkBoxTryNewSD.getSelection());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void performDefaults() {
|
protected void performDefaults() {
|
||||||
show_sup.setSelection(true);
|
show_sup.setSelection(true);
|
||||||
|
|
|
@ -16,6 +16,7 @@ import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||||
|
@ -61,8 +62,8 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
IWorkspaceRoot root;
|
IWorkspaceRoot root;
|
||||||
List tcList;
|
List tcList;
|
||||||
Map<String, IToolChain> tcMap = new HashMap<String, IToolChain>();
|
Map<String, IToolChain> tcMap = new HashMap<String, IToolChain>();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True if the user entered a non-empty string in the project name field. In that state, we avoid
|
* True if the user entered a non-empty string in the project name field. In that state, we avoid
|
||||||
* automatically filling the project name field with the directory name (last segment of the location) he
|
* automatically filling the project name field with the directory name (last segment of the location) he
|
||||||
|
@ -102,9 +103,9 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
|
|
||||||
// restore settings from preferences
|
// restore settings from preferences
|
||||||
boolean isTryNewSD = true;
|
boolean isTryNewSD = true;
|
||||||
boolean contains = CUIPlugin.getDefault().getPreferenceStore().contains(CDTPrefUtil.KEY_NEWSD);
|
boolean contains = CUIPlugin.getDefault().getPreferenceStore().contains(LanguageSettingsProvidersPage.KEY_NEWSD);
|
||||||
if (contains) {
|
if (contains) {
|
||||||
isTryNewSD = CDTPrefUtil.getBool(CDTPrefUtil.KEY_NEWSD);
|
isTryNewSD = CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NEWSD);
|
||||||
}
|
}
|
||||||
checkBoxTryNewSD.setSelection(isTryNewSD);
|
checkBoxTryNewSD.setSelection(isTryNewSD);
|
||||||
|
|
||||||
|
@ -130,7 +131,7 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Note that the modify listener gets called not only when the user enters text but also when we
|
// Note that the modify listener gets called not only when the user enters text but also when we
|
||||||
// programatically set the field. This listener only gets called when the user modifies the field
|
// programatically set the field. This listener only gets called when the user modifies the field
|
||||||
projectName.addKeyListener(new KeyAdapter() {
|
projectName.addKeyListener(new KeyAdapter() {
|
||||||
|
@ -140,17 +141,17 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates the contents of the page, setting the page error message and Finish button state accordingly
|
* Validates the contents of the page, setting the page error message and Finish button state accordingly
|
||||||
*
|
*
|
||||||
* @since 8.1
|
* @since 8.1
|
||||||
*/
|
*/
|
||||||
protected void validatePage() {
|
protected void validatePage() {
|
||||||
// Don't generate an error if project name or location is empty, but do disable Finish button.
|
// Don't generate an error if project name or location is empty, but do disable Finish button.
|
||||||
String msg = null;
|
String msg = null;
|
||||||
boolean complete = true; // ultimately treated as false if msg != null
|
boolean complete = true; // ultimately treated as false if msg != null
|
||||||
|
|
||||||
String name = getProjectName();
|
String name = getProjectName();
|
||||||
if (name.isEmpty()) {
|
if (name.isEmpty()) {
|
||||||
complete = false;
|
complete = false;
|
||||||
|
@ -278,11 +279,11 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
|
|
||||||
tcList = new List(group, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL);
|
tcList = new List(group, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL);
|
||||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||||
|
|
||||||
// Base the List control size on the number of total toolchains, up to 15 entries, but allocate for no
|
// Base the List control size on the number of total toolchains, up to 15 entries, but allocate for no
|
||||||
// less than five (small list boxes look strange). A vertical scrollbar will appear as needed
|
// less than five (small list boxes look strange). A vertical scrollbar will appear as needed
|
||||||
updateTcMap(false);
|
updateTcMap(false);
|
||||||
gd.heightHint = tcList.getItemHeight() * (1 + Math.max(Math.min(tcMap.size(), 15), 5)); // +1 for <none>
|
gd.heightHint = tcList.getItemHeight() * (1 + Math.max(Math.min(tcMap.size(), 15), 5)); // +1 for <none>
|
||||||
tcList.setLayoutData(gd);
|
tcList.setLayoutData(gd);
|
||||||
tcList.add(Messages.NewMakeProjFromExistingPage_11);
|
tcList.add(Messages.NewMakeProjFromExistingPage_11);
|
||||||
|
|
||||||
|
@ -300,11 +301,11 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
|
|
||||||
supportedOnly.setSelection(true);
|
supportedOnly.setSelection(true);
|
||||||
updateTcWidget(true);
|
updateTcWidget(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load our map and with the suitable toolchains and then populate the List control
|
* Load our map and with the suitable toolchains and then populate the List control
|
||||||
*
|
*
|
||||||
* @param supportedOnly
|
* @param supportedOnly
|
||||||
* if true, consider only supported toolchains
|
* if true, consider only supported toolchains
|
||||||
*/
|
*/
|
||||||
|
@ -323,7 +324,7 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load our map with the suitable toolchains.
|
* Load our map with the suitable toolchains.
|
||||||
*
|
*
|
||||||
* @param supportedOnly
|
* @param supportedOnly
|
||||||
* if true, add only toolchains that are available and which support the host platform
|
* if true, add only toolchains that are available and which support the host platform
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -52,11 +52,15 @@ public class ScannerDiscoveryLegacySupport {
|
||||||
private static Map<String, String> legacyProfiles = null;
|
private static Map<String, String> legacyProfiles = null;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get preferences node for org.eclipse.cdt.core.
|
||||||
|
*/
|
||||||
private static Preferences getPreferences(IProject project) {
|
private static Preferences getPreferences(IProject project) {
|
||||||
if (project == null)
|
if (project == null) {
|
||||||
return InstanceScope.INSTANCE.getNode(PREFERENCES_QUALIFIER).node(LANGUAGE_SETTINGS_PROVIDERS_NODE);
|
return InstanceScope.INSTANCE.getNode(PREFERENCES_QUALIFIER).node(LANGUAGE_SETTINGS_PROVIDERS_NODE);
|
||||||
else
|
} else {
|
||||||
return new LocalProjectScope(project).getNode(PREFERENCES_QUALIFIER).node(LANGUAGE_SETTINGS_PROVIDERS_NODE);
|
return new LocalProjectScope(project).getNode(PREFERENCES_QUALIFIER).node(LANGUAGE_SETTINGS_PROVIDERS_NODE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -65,9 +65,6 @@ public class LanguageSettingEntryDialog extends AbstractPropertyDialog {
|
||||||
private Button checkBoxBuiltIn;
|
private Button checkBoxBuiltIn;
|
||||||
private Button checkBoxFramework;
|
private Button checkBoxFramework;
|
||||||
|
|
||||||
private Button checkBoxAllCfgs;
|
|
||||||
private Button checkBoxAllLangs;
|
|
||||||
|
|
||||||
private Button buttonOk;
|
private Button buttonOk;
|
||||||
private Button buttonCancel;
|
private Button buttonCancel;
|
||||||
|
|
||||||
|
@ -393,26 +390,6 @@ public class LanguageSettingEntryDialog extends AbstractPropertyDialog {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Separator
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
Label separator = new Label(compCheckboxes, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_NONE);
|
|
||||||
|
|
||||||
// Checkbox "All configurations"
|
|
||||||
checkBoxAllCfgs = new Button(compCheckboxes, SWT.CHECK);
|
|
||||||
checkBoxAllCfgs.setText(Messages.IncludeDialog_2);
|
|
||||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
|
||||||
checkBoxAllCfgs.setLayoutData(gd);
|
|
||||||
checkBoxAllCfgs.setEnabled(false);
|
|
||||||
checkBoxAllCfgs.setToolTipText("Not implemented yet");
|
|
||||||
|
|
||||||
// Checkbox "All languages"
|
|
||||||
checkBoxAllLangs = new Button(compCheckboxes, SWT.CHECK);
|
|
||||||
checkBoxAllLangs.setText(Messages.IncludeDialog_3);
|
|
||||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
|
||||||
checkBoxAllLangs.setLayoutData(gd);
|
|
||||||
checkBoxAllLangs.setEnabled(false);
|
|
||||||
checkBoxAllLangs.setToolTipText("Not implemented yet");
|
|
||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
Composite compButtons = new Composite (parent, SWT.FILL);
|
Composite compButtons = new Composite (parent, SWT.FILL);
|
||||||
gd = new GridData(SWT.RIGHT, SWT.BOTTOM, false, false);
|
gd = new GridData(SWT.RIGHT, SWT.BOTTOM, false, false);
|
||||||
|
@ -516,8 +493,6 @@ public class LanguageSettingEntryDialog extends AbstractPropertyDialog {
|
||||||
String name = inputName.getText();
|
String name = inputName.getText();
|
||||||
text1 = name;
|
text1 = name;
|
||||||
String value = inputValue.getText();
|
String value = inputValue.getText();
|
||||||
check1 = checkBoxAllCfgs.getSelection();
|
|
||||||
check3 = checkBoxAllLangs.getSelection();
|
|
||||||
result = true;
|
result = true;
|
||||||
|
|
||||||
int flagBuiltIn = checkBoxBuiltIn.getSelection() ? ICSettingEntry.BUILTIN : 0;
|
int flagBuiltIn = checkBoxBuiltIn.getSelection() ? ICSettingEntry.BUILTIN : 0;
|
||||||
|
|
|
@ -346,7 +346,6 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab {
|
||||||
|
|
||||||
final TreeColumn columnLanguages = new TreeColumn(treeLanguages, SWT.NONE);
|
final TreeColumn columnLanguages = new TreeColumn(treeLanguages, SWT.NONE);
|
||||||
columnLanguages.setText(Messages.AbstractLangsListTab_Languages);
|
columnLanguages.setText(Messages.AbstractLangsListTab_Languages);
|
||||||
// TODO AG - why 200?
|
|
||||||
columnLanguages.setWidth(200);
|
columnLanguages.setWidth(200);
|
||||||
columnLanguages.setResizable(false);
|
columnLanguages.setResizable(false);
|
||||||
columnLanguages.setToolTipText(Messages.AbstractLangsListTab_Languages);
|
columnLanguages.setToolTipText(Messages.AbstractLangsListTab_Languages);
|
||||||
|
@ -354,7 +353,6 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab {
|
||||||
treeLanguages.addPaintListener(new PaintListener() {
|
treeLanguages.addPaintListener(new PaintListener() {
|
||||||
@Override
|
@Override
|
||||||
public void paintControl(PaintEvent e) {
|
public void paintControl(PaintEvent e) {
|
||||||
// TODO AG - why 5?
|
|
||||||
int x = treeLanguages.getBounds().width - 5;
|
int x = treeLanguages.getBounds().width - 5;
|
||||||
if (columnLanguages.getWidth() != x) {
|
if (columnLanguages.getWidth() != x) {
|
||||||
columnLanguages.setWidth(x);
|
columnLanguages.setWidth(x);
|
||||||
|
@ -383,7 +381,6 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab {
|
||||||
});
|
});
|
||||||
|
|
||||||
treeCol.setText(Messages.LanguageSettingsProviderTab_SettingEntries);
|
treeCol.setText(Messages.LanguageSettingsProviderTab_SettingEntries);
|
||||||
// TODO AG - why 200?
|
|
||||||
treeCol.setWidth(200);
|
treeCol.setWidth(200);
|
||||||
treeCol.setResizable(false);
|
treeCol.setResizable(false);
|
||||||
treeCol.setToolTipText(Messages.LanguageSettingsProviderTab_SettingEntriesTooltip);
|
treeCol.setToolTipText(Messages.LanguageSettingsProviderTab_SettingEntriesTooltip);
|
||||||
|
@ -579,7 +576,7 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab {
|
||||||
ILanguageSettingsProvider provider = getSelectedProvider();
|
ILanguageSettingsProvider provider = getSelectedProvider();
|
||||||
boolean isAllowedEditing = provider instanceof ILanguageSettingsEditableProvider
|
boolean isAllowedEditing = provider instanceof ILanguageSettingsEditableProvider
|
||||||
&& LanguageSettingsProviderAssociationManager.isAllowedToEditEntries(provider);
|
&& LanguageSettingsProviderAssociationManager.isAllowedToEditEntries(provider);
|
||||||
if (!isAllowedEditing) {
|
if (provider != null && !isAllowedEditing) {
|
||||||
status = new Status(IStatus.INFO, CUIPlugin.PLUGIN_ID, Messages.LanguageSettingsEntriesTab_Entries_Not_Editable);
|
status = new Status(IStatus.INFO, CUIPlugin.PLUGIN_ID, Messages.LanguageSettingsEntriesTab_Entries_Not_Editable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -693,6 +690,7 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab {
|
||||||
treeEntries.showItem(entryItem);
|
treeEntries.showItem(entryItem);
|
||||||
treeEntries.select(entryItem);
|
treeEntries.select(entryItem);
|
||||||
}
|
}
|
||||||
|
updateStatusLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1115,7 +1113,7 @@ providers: for (ILanguageSettingsProvider provider : oldProviders) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canBeVisible() {
|
public boolean canBeVisible() {
|
||||||
if (CDTPrefUtil.getBool(CDTPrefUtil.KEY_NO_SHOW_PROVIDERS)) {
|
if (CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,6 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.eclipse.core.resources.IResource;
|
|
||||||
import org.eclipse.core.runtime.Assert;
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
|
@ -73,7 +71,6 @@ import org.eclipse.cdt.internal.ui.newui.StatusMessageLine;
|
||||||
*/
|
*/
|
||||||
public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
|
public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
|
||||||
private static final String WORKSPACE_PREFERENCE_PAGE = "org.eclipse.cdt.ui.preferences.BuildSettingProperties"; //$NON-NLS-1$
|
private static final String WORKSPACE_PREFERENCE_PAGE = "org.eclipse.cdt.ui.preferences.BuildSettingProperties"; //$NON-NLS-1$
|
||||||
// TODO: generalize
|
|
||||||
private static final String TEST_PLUGIN_ID_PATTERN = "org.eclipse.cdt.*.tests.*"; //$NON-NLS-1$
|
private static final String TEST_PLUGIN_ID_PATTERN = "org.eclipse.cdt.*.tests.*"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String CLEAR_STR = Messages.LanguageSettingsProviderTab_Clear;
|
private static final String CLEAR_STR = Messages.LanguageSettingsProviderTab_Clear;
|
||||||
|
@ -211,8 +208,6 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider);
|
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider);
|
||||||
Assert.isTrue(rawProvider instanceof ILanguageSettingsEditableProvider);
|
|
||||||
|
|
||||||
ILanguageSettingsEditableProvider newProvider = LanguageSettingsManager.getProviderCopy((ILanguageSettingsEditableProvider)rawProvider, true);
|
ILanguageSettingsEditableProvider newProvider = LanguageSettingsManager.getProviderCopy((ILanguageSettingsEditableProvider)rawProvider, true);
|
||||||
if (newProvider != null) {
|
if (newProvider != null) {
|
||||||
replaceSelectedProvider(newProvider);
|
replaceSelectedProvider(newProvider);
|
||||||
|
@ -352,13 +347,6 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
|
||||||
return (List)Arrays.asList(tableProvidersViewer.getCheckedElements());
|
return (List)Arrays.asList(tableProvidersViewer.getCheckedElements());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Shortcut for getting the current resource for the property page.
|
|
||||||
*/
|
|
||||||
private IResource getResource() {
|
|
||||||
return (IResource)page.getElement();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replace the selected provider in UI and in configuration.
|
* Replace the selected provider in UI and in configuration.
|
||||||
*/
|
*/
|
||||||
|
@ -529,15 +517,12 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
boolean inProjectArea = projectStorageCheckBox.getSelection();
|
boolean inProjectArea = projectStorageCheckBox.getSelection();
|
||||||
ILanguageSettingsProvider newProvider = getWorkingCopy(getSelectedProvider().getId());
|
ILanguageSettingsProvider newProvider = getWorkingCopy(getSelectedProvider().getId());
|
||||||
Assert.isTrue(newProvider instanceof LanguageSettingsSerializableProvider);
|
|
||||||
|
|
||||||
LanguageSettingsManager.setStoringEntriesInProjectArea((LanguageSettingsSerializableProvider) newProvider, inProjectArea);
|
LanguageSettingsManager.setStoringEntriesInProjectArea((LanguageSettingsSerializableProvider) newProvider, inProjectArea);
|
||||||
replaceSelectedProvider(newProvider);
|
replaceSelectedProvider(newProvider);
|
||||||
createOptionsPage(newProvider);
|
createOptionsPage(newProvider);
|
||||||
displaySelectedOptionPage();
|
displaySelectedOptionPage();
|
||||||
updateButtons();
|
updateButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void widgetDefaultSelected(SelectionEvent e) {
|
public void widgetDefaultSelected(SelectionEvent e) {
|
||||||
widgetSelected(e);
|
widgetSelected(e);
|
||||||
|
@ -550,7 +535,6 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
|
||||||
*/
|
*/
|
||||||
private void createLinkToPreferences(final Composite parent, int span) {
|
private void createLinkToPreferences(final Composite parent, int span) {
|
||||||
linkToWorkspacePreferences = new Link(parent, SWT.NONE);
|
linkToWorkspacePreferences = new Link(parent, SWT.NONE);
|
||||||
// NLS.bind(Messages.GeneralMessages_NonAccessibleID, provider.getId());
|
|
||||||
String href = NLS.bind("<a href=\"workspace\">{0}</a>", Messages.LanguageSettingsProviderTab_WorkspaceSettings); //$NON-NLS-1$
|
String href = NLS.bind("<a href=\"workspace\">{0}</a>", Messages.LanguageSettingsProviderTab_WorkspaceSettings); //$NON-NLS-1$
|
||||||
linkToWorkspacePreferences.setText(NLS.bind(Messages.LanguageSettingsProviderTab_OptionsCanBeChangedInPreferencesDiscoveryTab, href));
|
linkToWorkspacePreferences.setText(NLS.bind(Messages.LanguageSettingsProviderTab_OptionsCanBeChangedInPreferencesDiscoveryTab, href));
|
||||||
GridData gd = new GridData();
|
GridData gd = new GridData();
|
||||||
|
@ -1177,7 +1161,7 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canBeVisible() {
|
public boolean canBeVisible() {
|
||||||
if (CDTPrefUtil.getBool(CDTPrefUtil.KEY_NO_SHOW_PROVIDERS)) {
|
if (CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,11 @@ import org.eclipse.cdt.ui.newui.ICPropertyTab;
|
||||||
* @noinstantiate This class is not intended to be instantiated by clients.
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
*/
|
*/
|
||||||
public class LanguageSettingsProvidersPage extends AbstractPage {
|
public class LanguageSettingsProvidersPage extends AbstractPage {
|
||||||
|
/** @since 5.4 */ // temporary key, subject to removal
|
||||||
|
public static final String KEY_NO_SHOW_PROVIDERS = "properties.providers.tab.disable"; //$NON-NLS-1$
|
||||||
|
/** @since 5.4 */ // temporary key, subject to removal
|
||||||
|
public static final String KEY_NEWSD = "wizard.try.new.sd.enable"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static boolean isLanguageSettingsProvidersEnabled = false;
|
private static boolean isLanguageSettingsProvidersEnabled = false;
|
||||||
private static IProject project = null;
|
private static IProject project = null;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.ui.language.settings.providers;
|
package org.eclipse.cdt.ui.language.settings.providers;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.Assert;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
|
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
|
||||||
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager;
|
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager;
|
||||||
|
@ -35,7 +36,6 @@ public abstract class AbstractLanguageSettingProviderOptionPage extends Abstract
|
||||||
* @param providerId - ID of the provider the options page is for.
|
* @param providerId - ID of the provider the options page is for.
|
||||||
*/
|
*/
|
||||||
public void init(AbstractCPropertyTab providerTab, String providerId) {
|
public void init(AbstractCPropertyTab providerTab, String providerId) {
|
||||||
Assert.isTrue(providerTab instanceof LanguageSettingsProviderTab);
|
|
||||||
this.providerTab = (LanguageSettingsProviderTab) providerTab;
|
this.providerTab = (LanguageSettingsProviderTab) providerTab;
|
||||||
this.providerId = providerId;
|
this.providerId = providerId;
|
||||||
}
|
}
|
||||||
|
@ -66,4 +66,14 @@ public abstract class AbstractLanguageSettingProviderOptionPage extends Abstract
|
||||||
providerTab.refreshItem(provider);
|
providerTab.refreshItem(provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void performApply(IProgressMonitor monitor) throws CoreException {
|
||||||
|
// normally should be handled by LanguageSettingsProviderTab
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void performDefaults() {
|
||||||
|
// normally should be handled by LanguageSettingsProviderTab
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,15 +33,11 @@ import org.eclipse.cdt.internal.ui.workingsets.WorkingSetConfigurationManager;
|
||||||
public class CDTPrefUtil {
|
public class CDTPrefUtil {
|
||||||
// boolean keys (KEY_NO-s are to be inverted !)
|
// boolean keys (KEY_NO-s are to be inverted !)
|
||||||
public static final String KEY_NOSUPP = "wizard.show.unsupported.disable"; //$NON-NLS-1$
|
public static final String KEY_NOSUPP = "wizard.show.unsupported.disable"; //$NON-NLS-1$
|
||||||
/** @since 5.4 */ // AG FIXME - remove before CDT Juno release
|
|
||||||
public static final String KEY_NEWSD = "wizard.try.new.sd.enable"; //$NON-NLS-1$
|
|
||||||
public static final String KEY_OTHERS = "wizard.group.others.enable"; //$NON-NLS-1$
|
public static final String KEY_OTHERS = "wizard.group.others.enable"; //$NON-NLS-1$
|
||||||
public static final String KEY_NOMNG = "properties.manage.config.disable"; //$NON-NLS-1$
|
public static final String KEY_NOMNG = "properties.manage.config.disable"; //$NON-NLS-1$
|
||||||
public static final String KEY_DTREE = "properties.data.hierarchy.enable"; //$NON-NLS-1$
|
public static final String KEY_DTREE = "properties.data.hierarchy.enable"; //$NON-NLS-1$
|
||||||
public static final String KEY_NOTOOLM = "properties.toolchain.modification.disable"; //$NON-NLS-1$
|
public static final String KEY_NOTOOLM = "properties.toolchain.modification.disable"; //$NON-NLS-1$
|
||||||
public static final String KEY_EXPORT = "properties.export.page.enable"; //$NON-NLS-1$
|
public static final String KEY_EXPORT = "properties.export.page.enable"; //$NON-NLS-1$
|
||||||
/** @since 5.4 */
|
|
||||||
public static final String KEY_NO_SHOW_PROVIDERS = "properties.providers.tab.disable"; //$NON-NLS-1$
|
|
||||||
/** @since 5.2 Show the "Include Files" settings entry tab */
|
/** @since 5.2 Show the "Include Files" settings entry tab */
|
||||||
public static final String KEY_SHOW_INC_FILES = "properties.includefiles.page.enable"; //$NON-NLS-1$
|
public static final String KEY_SHOW_INC_FILES = "properties.includefiles.page.enable"; //$NON-NLS-1$
|
||||||
/** @since 5.2 */
|
/** @since 5.2 */
|
||||||
|
|
|
@ -50,6 +50,7 @@ import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||||
import org.eclipse.cdt.ui.newui.PageLayout;
|
import org.eclipse.cdt.ui.newui.PageLayout;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
||||||
import org.eclipse.cdt.internal.ui.newui.Messages;
|
import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||||
|
|
||||||
public class CDTMainWizardPage extends WizardNewProjectCreationPage implements IWizardItemsListListener {
|
public class CDTMainWizardPage extends WizardNewProjectCreationPage implements IWizardItemsListListener {
|
||||||
|
@ -164,9 +165,9 @@ import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||||
|
|
||||||
// restore settings from preferences
|
// restore settings from preferences
|
||||||
boolean isTryNewSD = true;
|
boolean isTryNewSD = true;
|
||||||
boolean contains = CUIPlugin.getDefault().getPreferenceStore().contains(CDTPrefUtil.KEY_NEWSD);
|
boolean contains = CUIPlugin.getDefault().getPreferenceStore().contains(LanguageSettingsProvidersPage.KEY_NEWSD);
|
||||||
if (contains) {
|
if (contains) {
|
||||||
isTryNewSD = CDTPrefUtil.getBool(CDTPrefUtil.KEY_NEWSD);
|
isTryNewSD = CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NEWSD);
|
||||||
}
|
}
|
||||||
checkBoxTryNewSD.setSelection(isTryNewSD);
|
checkBoxTryNewSD.setSelection(isTryNewSD);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue