mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Bug #180266: specific discovery page for MBS discovery profiles
This commit is contained in:
parent
17d784913f
commit
6d2679f27e
12 changed files with 241 additions and 80 deletions
|
@ -407,9 +407,6 @@
|
|||
class="org.eclipse.cdt.make.ui.dialogs.GCCPerProjectSCDProfilePage"
|
||||
name="%GCCPerProjectProfile.name"
|
||||
profileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.cdt.make.ui.DiscoveryProfilePage">
|
||||
<profilePage
|
||||
class="org.eclipse.cdt.make.ui.dialogs.GCCPerFileSCDProfilePage"
|
||||
name="%GCCPerFileProfile.name"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2005 IBM Corporation and others.
|
||||
* Copyright (c) 2004, 2007 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -181,8 +181,8 @@ public abstract class AbstractDiscoveryOptionsBlock extends AbstractCOptionPage
|
|||
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(MakeUIPlugin.getPluginId(), "DiscoveryProfilePage"); //$NON-NLS-1$
|
||||
IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
|
||||
for (int i = 0; i < infos.length; i++) {
|
||||
if (infos[i].getName().equals(PROFILE_PAGE)) { //$NON-NLS-1$
|
||||
String id = infos[i].getAttribute(PROFILE_ID); //$NON-NLS-1$
|
||||
if (infos[i].getName().equals(PROFILE_PAGE)) {
|
||||
String id = infos[i].getAttribute(PROFILE_ID);
|
||||
fProfilePageMap.put(id, new DiscoveryProfilePageConfiguration(infos[i]));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2005 IBM Corporation and others.
|
||||
* Copyright (c) 2004, 2007 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -34,6 +34,30 @@ public abstract class AbstractDiscoveryPage extends DialogPage {
|
|||
protected static final String PROFILE_GROUP_LABEL = PREFIX + ".profile.group.label"; //$NON-NLS-1$
|
||||
private static final String VARIABLES_BUTTON = PREFIX + ".common.variables.button"; //$NON-NLS-1$
|
||||
|
||||
private static final String BO_PROVIDER_PARSER_ENABLED_BUTTON = PREFIX + ".boProvider.parser.enabled.button"; //$NON-NLS-1$
|
||||
private static final String BO_PROVIDER_OPEN_LABEL = PREFIX + ".boProvider.open.label"; //$NON-NLS-1$
|
||||
private static final String BO_PROVIDER_BROWSE_BUTTON = PREFIX + ".boProvider.browse.button"; //$NON-NLS-1$
|
||||
private static final String BO_PROVIDER_OPEN_FILE_DIALOG = PREFIX + ".boProvider.browse.openFileDialog"; //$NON-NLS-1$
|
||||
private static final String BO_PROVIDER_LOAD_BUTTON = PREFIX + ".boProvider.load.button"; //$NON-NLS-1$
|
||||
|
||||
private static final String SI_PROVIDER_PARSER_ENABLED_BUTTON = PREFIX + ".siProvider.parser.enabled.button"; //$NON-NLS-1$
|
||||
private static final String SI_PROVIDER_COMMAND_LABEL = PREFIX + ".siProvider.command.label"; //$NON-NLS-1$
|
||||
private static final String SI_PROVIDER_BROWSE_BUTTON = PREFIX + ".siProvider.browse.button"; //$NON-NLS-1$
|
||||
private static final String SI_PROVIDER_COMMAND_DIALOG = PREFIX + ".siProvider.browse.runCommandDialog"; //$NON-NLS-1$
|
||||
private static final String SI_PROVIDER_COMMAND_ERROR_MESSAGE= PREFIX + ".siProvider.command.errorMessage"; //$NON-NLS-1$
|
||||
|
||||
protected static final String B_ENABLE = MakeUIPlugin.getResourceString(BO_PROVIDER_PARSER_ENABLED_BUTTON);
|
||||
protected static final String L_OPEN = MakeUIPlugin.getResourceString(BO_PROVIDER_OPEN_LABEL);
|
||||
protected static final String B_BROWSE = MakeUIPlugin.getResourceString(BO_PROVIDER_BROWSE_BUTTON);
|
||||
protected static final String F_OPEN = MakeUIPlugin.getResourceString(BO_PROVIDER_OPEN_FILE_DIALOG);
|
||||
protected static final String B_LOAD = MakeUIPlugin.getResourceString(BO_PROVIDER_LOAD_BUTTON);
|
||||
|
||||
protected static final String SI_ENABLE = MakeUIPlugin.getResourceString(SI_PROVIDER_PARSER_ENABLED_BUTTON);
|
||||
protected static final String SI_COMMAND = MakeUIPlugin.getResourceString(SI_PROVIDER_COMMAND_LABEL);
|
||||
protected static final String SI_BROWSE = MakeUIPlugin.getResourceString(SI_PROVIDER_BROWSE_BUTTON);
|
||||
protected static final String SI_DIALOG = MakeUIPlugin.getResourceString(SI_PROVIDER_COMMAND_DIALOG);
|
||||
protected static final String SI_ERROR = MakeUIPlugin.getResourceString(SI_PROVIDER_COMMAND_ERROR_MESSAGE);
|
||||
|
||||
protected AbstractDiscoveryOptionsBlock fContainer; // parent
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2005 IBM Corporation and others.
|
||||
* Copyright (c) 2004, 2007 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -62,7 +62,7 @@ public class DiscoveryOptionsBlock extends AbstractDiscoveryOptionsBlock {
|
|||
private static final String SC_ENABLED_BUTTON = PREFIX + ".scGroup.enabled.button"; //$NON-NLS-1$
|
||||
private static final String SC_PROBLEM_REPORTING_ENABLED_BUTTON = PREFIX + ".scGroup.problemReporting.enabled.button"; //$NON-NLS-1$
|
||||
private static final String SC_SELECTED_PROFILE_COMBO = PREFIX + ".scGroup.selectedProfile.combo"; //$NON-NLS-1$
|
||||
private static final String BO_PROVIDER_GROUP_LABEL = PREFIX + ".boProvider.group.label"; //$NON-NLS-1$
|
||||
// private static final String BO_PROVIDER_GROUP_LABEL = PREFIX + ".boProvider.group.label"; //$NON-NLS-1$
|
||||
private static final String SC_APPLY_PROGRESS_MESSAGE = PREFIX + ".apply.progressMessage"; //$NON-NLS-1$
|
||||
|
||||
private Button scEnabledButton;
|
||||
|
@ -72,8 +72,8 @@ public class DiscoveryOptionsBlock extends AbstractDiscoveryOptionsBlock {
|
|||
|
||||
private boolean needsSCNature = false;
|
||||
private boolean fCreatePathContainer = false;
|
||||
private boolean isValid = true;
|
||||
private boolean persistedProfileChanged = false; // new persisted selected profile different than the old one
|
||||
// private boolean isValid = true;
|
||||
// private boolean persistedProfileChanged = false; // new persisted selected profile different than the old one
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -43,12 +43,6 @@ import org.eclipse.swt.widgets.Text;
|
|||
* @author vhirsl
|
||||
*/
|
||||
public class GCCPerFileSCDProfilePage extends AbstractDiscoveryPage {
|
||||
private static final String BO_PROVIDER_PARSER_ENABLED_BUTTON = PREFIX + ".boProvider.parser.enabled.button"; //$NON-NLS-1$
|
||||
private static final String BO_PROVIDER_OPEN_LABEL = PREFIX + ".boProvider.open.label"; //$NON-NLS-1$
|
||||
private static final String BO_PROVIDER_BROWSE_BUTTON = PREFIX + ".boProvider.browse.button"; //$NON-NLS-1$
|
||||
private static final String BO_PROVIDER_OPEN_FILE_DIALOG = PREFIX + ".boProvider.browse.openFileDialog"; //$NON-NLS-1$
|
||||
private static final String BO_PROVIDER_LOAD_BUTTON = PREFIX + ".boProvider.load.button"; //$NON-NLS-1$
|
||||
|
||||
private static final String providerId = "makefileGenerator"; //$NON-NLS-1$
|
||||
|
||||
private Button bopEnabledButton;
|
||||
|
@ -80,8 +74,7 @@ public class GCCPerFileSCDProfilePage extends AbstractDiscoveryPage {
|
|||
((GridLayout) profileGroup.getLayout()).makeColumnsEqualWidth = false;
|
||||
|
||||
// Add bop enabled checkbox
|
||||
bopEnabledButton = ControlFactory.createCheckBox(profileGroup,
|
||||
MakeUIPlugin.getResourceString(BO_PROVIDER_PARSER_ENABLED_BUTTON));
|
||||
bopEnabledButton = ControlFactory.createCheckBox(profileGroup, B_ENABLE);
|
||||
// bopEnabledButton.setFont(parent.getFont());
|
||||
((GridData)bopEnabledButton.getLayoutData()).horizontalSpan = 3;
|
||||
((GridData)bopEnabledButton.getLayoutData()).grabExcessHorizontalSpace = true;
|
||||
|
@ -94,13 +87,11 @@ public class GCCPerFileSCDProfilePage extends AbstractDiscoveryPage {
|
|||
});
|
||||
|
||||
// load label
|
||||
Label loadLabel = ControlFactory.createLabel(profileGroup,
|
||||
MakeUIPlugin.getResourceString(BO_PROVIDER_OPEN_LABEL));
|
||||
Label loadLabel = ControlFactory.createLabel(profileGroup, L_OPEN);
|
||||
((GridData) loadLabel.getLayoutData()).horizontalSpan = 2;
|
||||
|
||||
// load button
|
||||
bopLoadButton = ControlFactory.createPushButton(profileGroup,
|
||||
MakeUIPlugin.getResourceString(BO_PROVIDER_LOAD_BUTTON));
|
||||
bopLoadButton = ControlFactory.createPushButton(profileGroup, B_LOAD);
|
||||
((GridData) bopLoadButton.getLayoutData()).minimumWidth = 120;
|
||||
bopLoadButton.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
|
@ -123,8 +114,7 @@ public class GCCPerFileSCDProfilePage extends AbstractDiscoveryPage {
|
|||
bopLoadButton.setEnabled(loadButtonInitialEnabled && handleModifyOpenFileText());
|
||||
|
||||
// browse button
|
||||
Button browseButton = ControlFactory.createPushButton(profileGroup,
|
||||
MakeUIPlugin.getResourceString(BO_PROVIDER_BROWSE_BUTTON));
|
||||
Button browseButton = ControlFactory.createPushButton(profileGroup, B_BROWSE);
|
||||
((GridData) browseButton.getLayoutData()).minimumWidth = 120;
|
||||
browseButton.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
|
@ -134,7 +124,7 @@ public class GCCPerFileSCDProfilePage extends AbstractDiscoveryPage {
|
|||
|
||||
private void handleBOPBrowseButtonSelected() {
|
||||
FileDialog dialog = new FileDialog(getShell(), SWT.NONE);
|
||||
dialog.setText(MakeUIPlugin.getResourceString(BO_PROVIDER_OPEN_FILE_DIALOG));
|
||||
dialog.setText(F_OPEN);
|
||||
String fileName = getBopOpenFileText();
|
||||
IPath filterPath;
|
||||
if (fileName.length() == 0 && getContainer().getProject() != null) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2005 IBM Corporation and others.
|
||||
* Copyright (c) 2004, 2007 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -43,22 +43,8 @@ import org.eclipse.swt.widgets.Text;
|
|||
* @author vhirsl
|
||||
*/
|
||||
public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||
private static final String BO_PROVIDER_PARSER_ENABLED_BUTTON = PREFIX + ".boProvider.parser.enabled.button"; //$NON-NLS-1$
|
||||
private static final String BO_PROVIDER_OPEN_LABEL = PREFIX + ".boProvider.open.label"; //$NON-NLS-1$
|
||||
private static final String BO_PROVIDER_BROWSE_BUTTON = PREFIX + ".boProvider.browse.button"; //$NON-NLS-1$
|
||||
private static final String BO_PROVIDER_OPEN_FILE_DIALOG = PREFIX + ".boProvider.browse.openFileDialog"; //$NON-NLS-1$
|
||||
private static final String BO_PROVIDER_LOAD_BUTTON = PREFIX + ".boProvider.load.button"; //$NON-NLS-1$
|
||||
private static final String SI_PROVIDER_PARSER_ENABLED_BUTTON = PREFIX + ".siProvider.parser.enabled.button"; //$NON-NLS-1$
|
||||
private static final String SI_PROVIDER_COMMAND_LABEL = PREFIX + ".siProvider.command.label"; //$NON-NLS-1$
|
||||
private static final String SI_PROVIDER_BROWSE_BUTTON = PREFIX + ".siProvider.browse.button"; //$NON-NLS-1$
|
||||
private static final String SI_PROVIDER_COMMAND_DIALOG = PREFIX + ".siProvider.browse.runCommandDialog"; //$NON-NLS-1$
|
||||
private static final String SI_PROVIDER_COMMAND_ERROR_MESSAGE= PREFIX + ".siProvider.command.errorMessage"; //$NON-NLS-1$
|
||||
|
||||
private static final String providerId = "specsFile"; //$NON-NLS-1$
|
||||
|
||||
// thread syncronization
|
||||
//private static ILock lock = Platform.getJobManager().newLock();
|
||||
// private static Object lock = new Object();
|
||||
private static Object lock = GCCPerProjectSCDProfilePage.class;
|
||||
private Shell shell;
|
||||
private static GCCPerProjectSCDProfilePage instance;
|
||||
|
@ -87,39 +73,29 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
|||
GridData gd = (GridData) profileGroup.getLayoutData();
|
||||
gd.grabExcessHorizontalSpace = true;
|
||||
gd.horizontalAlignment = GridData.FILL;
|
||||
// PixelConverter converter = new PixelConverter(parent);
|
||||
// gd.heightHint = converter.convertVerticalDLUsToPixels(DEFAULT_HEIGHT);
|
||||
((GridLayout) profileGroup.getLayout()).makeColumnsEqualWidth = false;
|
||||
|
||||
// Add bop enabled checkbox
|
||||
bopEnabledButton = ControlFactory.createCheckBox(profileGroup,
|
||||
MakeUIPlugin.getResourceString(BO_PROVIDER_PARSER_ENABLED_BUTTON));
|
||||
// bopEnabledButton.setFont(parent.getFont());
|
||||
bopEnabledButton = ControlFactory.createCheckBox(profileGroup, B_ENABLE);
|
||||
((GridData)bopEnabledButton.getLayoutData()).horizontalSpan = 3;
|
||||
((GridData)bopEnabledButton.getLayoutData()).grabExcessHorizontalSpace = true;
|
||||
bopEnabledButton.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
handleModifyOpenFileText();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// load label
|
||||
Label loadLabel = ControlFactory.createLabel(profileGroup,
|
||||
MakeUIPlugin.getResourceString(BO_PROVIDER_OPEN_LABEL));
|
||||
Label loadLabel = ControlFactory.createLabel(profileGroup, L_OPEN);
|
||||
((GridData) loadLabel.getLayoutData()).horizontalSpan = 2;
|
||||
|
||||
// load button
|
||||
bopLoadButton = ControlFactory.createPushButton(profileGroup,
|
||||
MakeUIPlugin.getResourceString(BO_PROVIDER_LOAD_BUTTON));
|
||||
bopLoadButton = ControlFactory.createPushButton(profileGroup, B_LOAD);
|
||||
((GridData) bopLoadButton.getLayoutData()).minimumWidth = 120;
|
||||
bopLoadButton.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
handleBOPLoadFileButtonSelected();
|
||||
}
|
||||
|
||||
});
|
||||
if (getContainer().getProject() == null) { // project properties
|
||||
bopLoadButton.setVisible(false);
|
||||
|
@ -135,8 +111,7 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
|||
bopLoadButton.setEnabled(loadButtonInitialEnabled && handleModifyOpenFileText());
|
||||
|
||||
// browse button
|
||||
Button browseButton = ControlFactory.createPushButton(profileGroup,
|
||||
MakeUIPlugin.getResourceString(BO_PROVIDER_BROWSE_BUTTON));
|
||||
Button browseButton = ControlFactory.createPushButton(profileGroup, B_BROWSE);
|
||||
((GridData) browseButton.getLayoutData()).minimumWidth = 120;
|
||||
browseButton.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
|
@ -146,7 +121,7 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
|||
|
||||
private void handleBOPBrowseButtonSelected() {
|
||||
FileDialog dialog = new FileDialog(getShell(), SWT.NONE);
|
||||
dialog.setText(MakeUIPlugin.getResourceString(BO_PROVIDER_OPEN_FILE_DIALOG));
|
||||
dialog.setText(F_OPEN);
|
||||
String fileName = getBopOpenFileText();
|
||||
IPath filterPath;
|
||||
if (fileName.length() == 0 && getContainer().getProject() != null) {
|
||||
|
@ -167,26 +142,20 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
|||
|
||||
// variable button
|
||||
addVariablesButton(profileGroup, bopOpenFileText);
|
||||
|
||||
ControlFactory.createSeparator(profileGroup, 3);
|
||||
|
||||
// si provider enabled checkbox
|
||||
sipEnabledButton = ControlFactory.createCheckBox(profileGroup,
|
||||
MakeUIPlugin.getResourceString(SI_PROVIDER_PARSER_ENABLED_BUTTON));
|
||||
// sipEnabledButton.setFont(parent.getFont());
|
||||
sipEnabledButton = ControlFactory.createCheckBox(profileGroup, SI_ENABLE);
|
||||
((GridData)sipEnabledButton.getLayoutData()).horizontalSpan = 3;
|
||||
((GridData)sipEnabledButton.getLayoutData()).grabExcessHorizontalSpace = true;
|
||||
sipEnabledButton.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
// bopLoadButton.setEnabled(sipEnabledButton.getSelection());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// si command label
|
||||
Label siCommandLabel = ControlFactory.createLabel(profileGroup,
|
||||
MakeUIPlugin.getResourceString(SI_PROVIDER_COMMAND_LABEL));
|
||||
Label siCommandLabel = ControlFactory.createLabel(profileGroup, SI_COMMAND);
|
||||
((GridData) siCommandLabel.getLayoutData()).horizontalSpan = 3;
|
||||
|
||||
// text field
|
||||
|
@ -199,8 +168,7 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
|||
});
|
||||
|
||||
// si browse button
|
||||
Button siBrowseButton = ControlFactory.createPushButton(profileGroup,
|
||||
MakeUIPlugin.getResourceString(SI_PROVIDER_BROWSE_BUTTON));
|
||||
Button siBrowseButton = ControlFactory.createPushButton(profileGroup, SI_BROWSE);
|
||||
((GridData) siBrowseButton.getLayoutData()).minimumWidth = 120;
|
||||
siBrowseButton.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
|
@ -210,7 +178,7 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
|||
|
||||
private void handleSIPBrowseButtonSelected() {
|
||||
FileDialog dialog = new FileDialog(getShell(), SWT.NONE);
|
||||
dialog.setText(MakeUIPlugin.getResourceString(SI_PROVIDER_COMMAND_DIALOG));
|
||||
dialog.setText(SI_DIALOG);
|
||||
String fileName = sipRunCommandText.getText().trim();
|
||||
int lastSeparatorIndex = fileName.lastIndexOf(File.separator);
|
||||
if (lastSeparatorIndex != -1) {
|
||||
|
@ -226,12 +194,10 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
|||
|
||||
setControl(page);
|
||||
// set the shell variable; must be after setControl
|
||||
//lock.acquire();
|
||||
synchronized (lock) {
|
||||
shell = getShell();
|
||||
instance = this;
|
||||
}
|
||||
//lock.release();
|
||||
initializeValues();
|
||||
}
|
||||
|
||||
|
@ -304,7 +270,6 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
|||
readerJob.addJobChangeListener(new JobChangeAdapter() {
|
||||
|
||||
public void done(IJobChangeEvent event) {
|
||||
//lock.acquire();
|
||||
synchronized (lock) {
|
||||
if (!instance.shell.isDisposed()) {
|
||||
instance.shell.getDisplay().asyncExec(new Runnable() {
|
||||
|
@ -325,7 +290,6 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
|||
loadButtonInitialEnabled = true;
|
||||
}
|
||||
}
|
||||
//lock.release();
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -343,7 +307,7 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
|||
* @see org.eclipse.jface.dialogs.IDialogPage#getErrorMessage()
|
||||
*/
|
||||
public String getErrorMessage() {
|
||||
return (isValid) ? null : MakeUIPlugin.getResourceString(SI_PROVIDER_COMMAND_ERROR_MESSAGE);
|
||||
return (isValid) ? null : SI_ERROR;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -0,0 +1,155 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2007 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.make.ui.dialogs;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
|
||||
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
|
||||
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.FileDialog;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
/**
|
||||
* SCD per project profile property/preference page
|
||||
*
|
||||
* @author vhirsl
|
||||
*/
|
||||
public class MBSPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||
private static final String providerId = "specsFile"; //$NON-NLS-1$
|
||||
|
||||
private Button sipEnabledButton;
|
||||
private Text sipRunCommandText;
|
||||
private boolean isValid = true;
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.ui.dialogs.AbstractCOptionPage#createControl(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
public void createControl(Composite parent) {
|
||||
Composite page = ControlFactory.createComposite(parent, 1);
|
||||
|
||||
// Add the profile UI contribution.
|
||||
Group profileGroup = ControlFactory.createGroup(page,
|
||||
MakeUIPlugin.getResourceString(PROFILE_GROUP_LABEL), 3);
|
||||
|
||||
GridData gd = (GridData) profileGroup.getLayoutData();
|
||||
gd.grabExcessHorizontalSpace = true;
|
||||
gd.horizontalAlignment = GridData.FILL;
|
||||
((GridLayout) profileGroup.getLayout()).makeColumnsEqualWidth = false;
|
||||
|
||||
// si provider enabled checkbox
|
||||
sipEnabledButton = ControlFactory.createCheckBox(profileGroup, SI_ENABLE);
|
||||
((GridData)sipEnabledButton.getLayoutData()).horizontalSpan = 3;
|
||||
((GridData)sipEnabledButton.getLayoutData()).grabExcessHorizontalSpace = true;
|
||||
sipEnabledButton.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
}
|
||||
});
|
||||
|
||||
// si command label
|
||||
Label siCommandLabel = ControlFactory.createLabel(profileGroup, SI_COMMAND);
|
||||
((GridData) siCommandLabel.getLayoutData()).horizontalSpan = 3;
|
||||
|
||||
// text field
|
||||
sipRunCommandText = ControlFactory.createTextField(profileGroup, SWT.SINGLE | SWT.BORDER);
|
||||
//((GridData) sipRunCommandText.getLayoutData()).horizontalSpan = 2;
|
||||
sipRunCommandText.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
handleModifyRunCommandText();
|
||||
}
|
||||
});
|
||||
|
||||
// si browse button
|
||||
Button siBrowseButton = ControlFactory.createPushButton(profileGroup, SI_BROWSE);
|
||||
((GridData) siBrowseButton.getLayoutData()).minimumWidth = 120;
|
||||
siBrowseButton.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
handleSIPBrowseButtonSelected();
|
||||
}
|
||||
|
||||
private void handleSIPBrowseButtonSelected() {
|
||||
FileDialog dialog = new FileDialog(getShell(), SWT.NONE);
|
||||
dialog.setText(SI_DIALOG);
|
||||
String fileName = sipRunCommandText.getText().trim();
|
||||
int lastSeparatorIndex = fileName.lastIndexOf(File.separator);
|
||||
if (lastSeparatorIndex != -1) {
|
||||
dialog.setFilterPath(fileName.substring(0, lastSeparatorIndex));
|
||||
}
|
||||
String res = dialog.open();
|
||||
if (res == null) {
|
||||
return;
|
||||
}
|
||||
sipRunCommandText.setText(res);
|
||||
}
|
||||
});
|
||||
setControl(page);
|
||||
initializeValues();
|
||||
}
|
||||
|
||||
private void handleModifyRunCommandText() {
|
||||
String cmd = sipRunCommandText.getText().trim();
|
||||
isValid = (cmd.length() > 0) ? true : false;
|
||||
getContainer().updateContainer();
|
||||
}
|
||||
|
||||
private void initializeValues() {
|
||||
sipEnabledButton.setSelection(getContainer().getBuildInfo().isProviderOutputParserEnabled(providerId));
|
||||
sipRunCommandText.setText(getContainer().getBuildInfo().getProviderRunCommand(providerId));
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.ui.dialogs.ICOptionPage#isValid()
|
||||
*/
|
||||
public boolean isValid() {
|
||||
return isValid;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.dialogs.IDialogPage#getErrorMessage()
|
||||
*/
|
||||
public String getErrorMessage() {
|
||||
return (isValid) ? null : SI_ERROR;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.make.ui.dialogs.AbstractDiscoveryPage#populateBuildInfo(org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2)
|
||||
*/
|
||||
protected void populateBuildInfo(IScannerConfigBuilderInfo2 buildInfo) {
|
||||
if (buildInfo != null) {
|
||||
buildInfo.setBuildOutputFileActionEnabled(true);
|
||||
buildInfo.setProviderOutputParserEnabled(providerId, sipEnabledButton.getSelection());
|
||||
buildInfo.setProviderRunCommand(providerId, sipRunCommandText.getText().trim());
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.make.ui.dialogs.AbstractDiscoveryPage#restoreFromBuildinfo(org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2)
|
||||
*/
|
||||
protected void restoreFromBuildinfo(IScannerConfigBuilderInfo2 buildInfo) {
|
||||
if (buildInfo != null) {
|
||||
sipEnabledButton.setSelection(buildInfo.isProviderOutputParserEnabled(providerId));
|
||||
sipRunCommandText.setText(buildInfo.getProviderRunCommand(providerId));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -91,7 +91,7 @@ public class MakeTargetDialog extends Dialog {
|
|||
buildCommand = target.getBuildCommand();
|
||||
buildArguments = target.getBuildArguments();
|
||||
targetName = target.getName();
|
||||
targetString = target.getBuildAttribute(IMakeTarget.BUILD_TARGET, "all");
|
||||
targetString = target.getBuildAttribute(IMakeTarget.BUILD_TARGET, "all"); //$NON-NLS-1$
|
||||
targetBuildID = target.getTargetBuilderID();
|
||||
runAllBuilders = target.runAllBuilders();
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ public class MakeTargetDialog extends Dialog {
|
|||
if (commandText.getText().equals("")) { //$NON-NLS-1$
|
||||
fStatusLine.setErrorMessage(MakeUIPlugin.getResourceString("MakeTargetDialog.message.mustSpecifyBuildCommand")); //$NON-NLS-1$
|
||||
} else {
|
||||
fStatusLine.setErrorMessage(null); //$NON-NLS-1$
|
||||
fStatusLine.setErrorMessage(null);
|
||||
}
|
||||
updateButtons();
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class SettingsBlock extends AbstractCOptionPage {
|
|||
private static final String MAKE_WORKBENCH_BUILD_TARGET = PREFIX + ".makeWorkbench.target"; //$NON-NLS-1$
|
||||
private static final String MAKE_WORKBENCH_BUILD_AUTO = PREFIX + ".makeWorkbench.auto"; //$NON-NLS-1$
|
||||
private static final String MAKE_WORKBENCH_BUILD_INCR = PREFIX + ".makeWorkbench.incremental"; //$NON-NLS-1$
|
||||
private static final String MAKE_WORKBENCH_BUILD_FULL = PREFIX + ".makeWorkbench.full"; //$NON-NLS-1$
|
||||
// private static final String MAKE_WORKBENCH_BUILD_FULL = PREFIX + ".makeWorkbench.full"; //$NON-NLS-1$
|
||||
private static final String MAKE_WORKBENCH_BUILD_CLEAN = PREFIX + ".makeWorkbench.clean"; //$NON-NLS-1$
|
||||
|
||||
private static final String MAKE_BUILD_DIR_GROUP = PREFIX + ".makeLoc.group_label"; //$NON-NLS-1$
|
||||
|
@ -80,7 +80,7 @@ public class SettingsBlock extends AbstractCOptionPage {
|
|||
|
||||
private static final String MAKE_BUILD_AUTO_TARGET = PREFIX + ".makeWorkbench.autoBuildTarget"; //$NON-NLS-1$
|
||||
private static final String MAKE_BUILD_INCREMENTAL_TARGET = PREFIX + ".makeWorkbench.incrementalBuildTarget"; //$NON-NLS-1$
|
||||
private static final String MAKE_BUILD_FULL_TARGET = PREFIX + ".makeWorkbench.fullBuildTarget"; //$NON-NLS-1$
|
||||
// private static final String MAKE_BUILD_FULL_TARGET = PREFIX + ".makeWorkbench.fullBuildTarget"; //$NON-NLS-1$
|
||||
private static final String MAKE_BUILD_CLEAN_TARGET = PREFIX + ".makeWorkbench.cleanTarget"; //$NON-NLS-1$
|
||||
|
||||
Button stopOnErrorButton;
|
||||
|
@ -367,7 +367,7 @@ public class SettingsBlock extends AbstractCOptionPage {
|
|||
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.NONE);
|
||||
dialog.setText(MakeUIPlugin.getResourceString("SettingsBlock.title.selectLocationToBuildFrom"));
|
||||
dialog.setText(MakeUIPlugin.getResourceString("SettingsBlock.title.selectLocationToBuildFrom")); //$NON-NLS-1$
|
||||
dialog.setFilterPath(getContainer().getProject().toString());
|
||||
String directory = dialog.open();
|
||||
if (directory != null) {
|
||||
|
|
|
@ -89,3 +89,4 @@ Data.hierarchy=Data hierarchy
|
|||
Preferred.toolchains=Preferred toolchains
|
||||
Wizard.defaults=Wizard defaults
|
||||
PropertyPage.defaults=Property page settings
|
||||
MBSPerProjectProfile.name=Managed Build System - per project scanner info profile
|
|
@ -619,4 +619,31 @@
|
|||
</page>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.cdt.make.ui.DiscoveryProfilePage">
|
||||
<profilePage
|
||||
class="org.eclipse.cdt.make.ui.dialogs.MBSPerProjectSCDProfilePage"
|
||||
name="%MBSPerProjectProfile.name"
|
||||
profileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"/>
|
||||
<profilePage
|
||||
class="org.eclipse.cdt.make.ui.dialogs.MBSPerProjectSCDProfilePage"
|
||||
name="%MBSPerProjectProfile.name"
|
||||
profileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
|
||||
<profilePage
|
||||
class="org.eclipse.cdt.make.ui.dialogs.MBSPerProjectSCDProfilePage"
|
||||
name="%MBSPerProjectProfile.name"
|
||||
profileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
|
||||
<profilePage
|
||||
class="org.eclipse.cdt.make.ui.dialogs.MBSPerProjectSCDProfilePage"
|
||||
name="%MBSPerProjectProfile.name"
|
||||
profileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"/>
|
||||
<profilePage
|
||||
class="org.eclipse.cdt.make.ui.dialogs.MBSPerProjectSCDProfilePage"
|
||||
name="%MBSPerProjectProfile.name"
|
||||
profileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"/>
|
||||
<profilePage
|
||||
class="org.eclipse.cdt.make.ui.dialogs.MBSPerProjectSCDProfilePage"
|
||||
name="%MBSPerProjectProfile.name"
|
||||
profileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"/>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -273,6 +273,9 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
|
|||
String savedId = buildInfo.getSelectedProfileId();
|
||||
while (it.hasNext()) {
|
||||
String profileId = (String)it.next();
|
||||
|
||||
System.out.println(profileId);
|
||||
|
||||
if (!cbi.isProfileSupported(iContext, profileId))
|
||||
continue;
|
||||
visibleProfilesList.add(profileId);
|
||||
|
|
Loading…
Add table
Reference in a new issue