mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 22:22:11 +02:00
[261232] update to XLC wizard so that it can be reused for UPC
This commit is contained in:
parent
436a3e5dd3
commit
01ce038d6f
2 changed files with 17 additions and 30 deletions
|
@ -131,20 +131,20 @@ public class XLCSettingsWizardPage extends MBSCustomPage {
|
|||
fDirTextBox.setText(compilerPath);
|
||||
|
||||
// update the page manager with the setting
|
||||
MBSCustomPageManager.addPageProperty(PAGE_ID, PreferenceConstants.P_XL_COMPILER_ROOT, fDirTextBox.getText());
|
||||
MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XL_COMPILER_ROOT, fDirTextBox.getText());
|
||||
|
||||
fDirTextBox.addModifyListener(new ModifyListener() {
|
||||
|
||||
public void modifyText(ModifyEvent e) {
|
||||
// update the page manager with the setting
|
||||
MBSCustomPageManager.addPageProperty(PAGE_ID, PreferenceConstants.P_XL_COMPILER_ROOT, fDirTextBox.getText());
|
||||
MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XL_COMPILER_ROOT, fDirTextBox.getText());
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// create the browse button
|
||||
String selectedPath = null;
|
||||
//String selectedPath = null;
|
||||
GridData buttonData = new GridData();
|
||||
buttonData.horizontalAlignment = SWT.RIGHT;
|
||||
Button browseButton = new Button(fComposite, SWT.PUSH);
|
||||
|
@ -179,13 +179,13 @@ public class XLCSettingsWizardPage extends MBSCustomPage {
|
|||
fVersionCombo.setText(compilerVersion);
|
||||
|
||||
// update the page manager with the setting
|
||||
MBSCustomPageManager.addPageProperty(PAGE_ID, PreferenceConstants.P_XLC_COMPILER_VERSION, fVersionCombo.getText());
|
||||
MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XLC_COMPILER_VERSION, fVersionCombo.getText());
|
||||
|
||||
fVersionCombo.addModifyListener(new ModifyListener() {
|
||||
|
||||
public void modifyText(ModifyEvent e) {
|
||||
// update the page manager with the setting
|
||||
MBSCustomPageManager.addPageProperty(PAGE_ID, PreferenceConstants.P_XLC_COMPILER_VERSION, fVersionCombo.getText());
|
||||
MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XLC_COMPILER_VERSION, fVersionCombo.getText());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 IBM Corporation and others.
|
||||
* Copyright (c) 2007, 2009 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
|
||||
|
@ -12,9 +12,10 @@ package org.eclipse.cdt.managedbuilder.xlc.ui.wizards;
|
|||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import org.eclipse.cdt.ui.wizards.CDTCommonProjectWizard;
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager;
|
||||
import org.eclipse.cdt.managedbuilder.xlc.ui.preferences.PreferenceConstants;
|
||||
import org.eclipse.cdt.ui.wizards.CDTCommonProjectWizard;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
|
@ -28,21 +29,15 @@ import org.eclipse.jface.wizard.IWizardPage;
|
|||
*/
|
||||
public class XLCSettingsWizardRunnable implements IRunnableWithProgress {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected String pageId = XLCSettingsWizardPage.PAGE_ID;
|
||||
|
||||
public XLCSettingsWizardRunnable() {
|
||||
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
|
||||
*/
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException,
|
||||
InterruptedException {
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
// take the data from the page manager, and set the project properties with it
|
||||
String compilerPath = MBSCustomPageManager.getPageProperty(XLCSettingsWizardPage.PAGE_ID, PreferenceConstants.P_XL_COMPILER_ROOT).toString();
|
||||
String compilerVersion = MBSCustomPageManager.getPageProperty(XLCSettingsWizardPage.PAGE_ID, PreferenceConstants.P_XLC_COMPILER_VERSION).toString();
|
||||
String compilerPath = MBSCustomPageManager.getPageProperty(pageId, PreferenceConstants.P_XL_COMPILER_ROOT).toString();
|
||||
String compilerVersion = MBSCustomPageManager.getPageProperty(pageId, PreferenceConstants.P_XLC_COMPILER_VERSION).toString();
|
||||
|
||||
// get a handle to the wizard
|
||||
IWizardPage[] pages = MBSCustomPageManager.getPages();
|
||||
|
@ -50,24 +45,16 @@ public class XLCSettingsWizardRunnable implements IRunnableWithProgress {
|
|||
if(pages != null && pages.length > 0) {
|
||||
|
||||
CDTCommonProjectWizard wizard = (CDTCommonProjectWizard) pages[0].getWizard();
|
||||
|
||||
IProject project = wizard.getLastProject();
|
||||
|
||||
try {
|
||||
project.setPersistentProperty(new QualifiedName("",
|
||||
PreferenceConstants.P_XL_COMPILER_ROOT), compilerPath);
|
||||
|
||||
project.setPersistentProperty(new QualifiedName("",
|
||||
PreferenceConstants.P_XLC_COMPILER_VERSION), compilerVersion);
|
||||
project.setPersistentProperty(new QualifiedName("", PreferenceConstants.P_XL_COMPILER_ROOT), compilerPath);
|
||||
project.setPersistentProperty(new QualifiedName("", PreferenceConstants.P_XLC_COMPILER_VERSION), compilerVersion);
|
||||
|
||||
} catch (CoreException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
CCorePlugin.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue