mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-02 05:45:58 +02:00
additional fix for [Bug 184185] New CDTWizard extension mechanism should use abstract classes instead of interfaces
This commit is contained in:
parent
e3448230ed
commit
5961aaeb02
4 changed files with 12 additions and 12 deletions
|
@ -18,7 +18,7 @@ import org.eclipse.cdt.managedbuilder.ui.wizards.ICBuildWizardHandler;
|
||||||
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.ui.wizards.CDTMainWizardPage;
|
import org.eclipse.cdt.ui.wizards.CDTMainWizardPage;
|
||||||
import org.eclipse.cdt.ui.wizards.ICWizardHandler;
|
import org.eclipse.cdt.ui.wizards.CWizardHandler;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
|
@ -32,7 +32,7 @@ import org.eclipse.swt.widgets.TreeItem;
|
||||||
|
|
||||||
public class PreferredToolchainsTab extends AbstractCBuildPropertyTab {
|
public class PreferredToolchainsTab extends AbstractCBuildPropertyTab {
|
||||||
|
|
||||||
protected ICWizardHandler h_selected = null;
|
protected CWizardHandler h_selected = null;
|
||||||
// widgets
|
// widgets
|
||||||
private Tree tree;
|
private Tree tree;
|
||||||
private Composite right;
|
private Composite right;
|
||||||
|
@ -65,7 +65,7 @@ public class PreferredToolchainsTab extends AbstractCBuildPropertyTab {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
TreeItem[] tis = tree.getSelection();
|
TreeItem[] tis = tree.getSelection();
|
||||||
if (tis == null || tis.length == 0) return;
|
if (tis == null || tis.length == 0) return;
|
||||||
switchTo((ICWizardHandler)tis[0].getData());
|
switchTo((CWizardHandler)tis[0].getData());
|
||||||
}});
|
}});
|
||||||
|
|
||||||
right = new Composite(c, SWT.NONE);
|
right = new Composite(c, SWT.NONE);
|
||||||
|
@ -122,7 +122,7 @@ public class PreferredToolchainsTab extends AbstractCBuildPropertyTab {
|
||||||
h_selected.updatePreferred(CDTPrefUtil.getPreferredTCs());
|
h_selected.updatePreferred(CDTPrefUtil.getPreferredTCs());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void switchTo(ICWizardHandler h) {
|
private void switchTo(CWizardHandler h) {
|
||||||
if (h == null) return;
|
if (h == null) return;
|
||||||
if (h_selected != null) h_selected.handleUnSelection();
|
if (h_selected != null) h_selected.handleUnSelection();
|
||||||
h_selected = h;
|
h_selected = h;
|
||||||
|
|
|
@ -56,7 +56,7 @@ implements IExecutableExtension, IWizardWithMemory
|
||||||
|
|
||||||
private String lastProjectName = null;
|
private String lastProjectName = null;
|
||||||
private IPath lastProjectLocation = null;
|
private IPath lastProjectLocation = null;
|
||||||
private ICWizardHandler savedHandler = null;
|
private CWizardHandler savedHandler = null;
|
||||||
|
|
||||||
protected List localPages = new ArrayList(); // replacing Wizard.pages since we have to delete them
|
protected List localPages = new ArrayList(); // replacing Wizard.pages since we have to delete them
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||||
private Label right_label;
|
private Label right_label;
|
||||||
|
|
||||||
private ProjectContentsArea locationArea;
|
private ProjectContentsArea locationArea;
|
||||||
public ICWizardHandler h_selected = null;
|
public CWizardHandler h_selected = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new project creation wizard page.
|
* Creates a new project creation wizard page.
|
||||||
|
@ -143,7 +143,7 @@ import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
TreeItem[] tis = tree.getSelection();
|
TreeItem[] tis = tree.getSelection();
|
||||||
if (tis == null || tis.length == 0) return;
|
if (tis == null || tis.length == 0) return;
|
||||||
switchTo((ICWizardHandler)tis[0].getData(), (EntryDescriptor)tis[0].getData(DESC));
|
switchTo((CWizardHandler)tis[0].getData(), (EntryDescriptor)tis[0].getData(DESC));
|
||||||
setPageComplete(validatePage());
|
setPageComplete(validatePage());
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||||
return locationArea.isDefault();
|
return locationArea.isDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ICWizardHandler updateData(Tree tree, Composite right, Button show_sup, IWizardItemsListListener ls, IWizard wizard) {
|
public static CWizardHandler updateData(Tree tree, Composite right, Button show_sup, IWizardItemsListListener ls, IWizard wizard) {
|
||||||
// remember selected item
|
// remember selected item
|
||||||
TreeItem[] sel = tree.getSelection();
|
TreeItem[] sel = tree.getSelection();
|
||||||
String savedStr = (sel.length > 0) ? sel[0].getText() : null;
|
String savedStr = (sel.length > 0) ? sel[0].getText() : null;
|
||||||
|
@ -449,7 +449,7 @@ import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tree.setSelection(target);
|
tree.setSelection(target);
|
||||||
return (ICWizardHandler)target.getData();
|
return (CWizardHandler)target.getData();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,7 @@ import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||||
if (wd2.getId().equals(wd1.getParentId())) {
|
if (wd2.getId().equals(wd1.getParentId())) {
|
||||||
found = true;
|
found = true;
|
||||||
wd1.setParentId(null);
|
wd1.setParentId(null);
|
||||||
ICWizardHandler h = wd2.getHandler();
|
CWizardHandler h = wd2.getHandler();
|
||||||
if (h == null && !wd1.isCategory())
|
if (h == null && !wd1.isCategory())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -514,7 +514,7 @@ import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||||
// orphan elements (with not-existing parentId) are ignored
|
// orphan elements (with not-existing parentId) are ignored
|
||||||
}
|
}
|
||||||
|
|
||||||
private void switchTo(ICWizardHandler h, EntryDescriptor ed) {
|
private void switchTo(CWizardHandler h, EntryDescriptor ed) {
|
||||||
|
|
||||||
if (h == null) h = ed.getHandler();
|
if (h == null) h = ed.getHandler();
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||||
* - processing data received from config page
|
* - processing data received from config page
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class CWizardHandler implements ICWizardHandler {
|
public class CWizardHandler implements Cloneable {
|
||||||
protected static final Image IMG0 = CPluginImages.get(CPluginImages.IMG_EMPTY);
|
protected static final Image IMG0 = CPluginImages.get(CPluginImages.IMG_EMPTY);
|
||||||
protected static final Image IMG1 = CPluginImages.get(CPluginImages.IMG_PREFERRED);
|
protected static final Image IMG1 = CPluginImages.get(CPluginImages.IMG_PREFERRED);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue