mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
Cosmetics.
This commit is contained in:
parent
06e1b830a8
commit
eb081d7f1f
3 changed files with 411 additions and 415 deletions
|
@ -6,10 +6,9 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
* Andrew Ferguson (Symbian)
|
* Andrew Ferguson (Symbian)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.core.index;
|
package org.eclipse.cdt.core.index;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ILinkage;
|
import org.eclipse.cdt.core.dom.ILinkage;
|
||||||
|
@ -26,5 +25,5 @@ public interface IIndexLinkage extends ILinkage {
|
||||||
* Empty IIndexLinkage array constant
|
* Empty IIndexLinkage array constant
|
||||||
* @since 4.0.1
|
* @since 4.0.1
|
||||||
*/
|
*/
|
||||||
IIndexLinkage[] EMPTY_INDEX_LINKAGE_ARRAY= new IIndexLinkage[0];
|
IIndexLinkage[] EMPTY_INDEX_LINKAGE_ARRAY= {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ import org.eclipse.core.runtime.Assert;
|
||||||
/**
|
/**
|
||||||
* Specialization of a class.
|
* Specialization of a class.
|
||||||
*/
|
*/
|
||||||
public class CPPClassSpecialization extends CPPSpecialization
|
public class CPPClassSpecialization extends CPPSpecialization
|
||||||
implements ICPPClassSpecialization, ICPPInternalClassTypeMixinHost {
|
implements ICPPClassSpecialization, ICPPInternalClassTypeMixinHost {
|
||||||
|
|
||||||
public static class RecursionResolvingBinding extends ProblemBinding implements ICPPMember, IRecursionResolvingBinding {
|
public static class RecursionResolvingBinding extends ProblemBinding implements ICPPMember, IRecursionResolvingBinding {
|
||||||
|
@ -156,34 +156,34 @@ public class CPPClassSpecialization extends CPPSpecialization
|
||||||
public ICPPClassType getSpecializedBinding() {
|
public ICPPClassType getSpecializedBinding() {
|
||||||
return (ICPPClassType) super.getSpecializedBinding();
|
return (ICPPClassType) super.getSpecializedBinding();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBinding specializeMember(IBinding original) {
|
public IBinding specializeMember(IBinding original) {
|
||||||
return specializeMember(original, null);
|
return specializeMember(original, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBinding specializeMember(IBinding original, IASTNode point) {
|
public IBinding specializeMember(IBinding original, IASTNode point) {
|
||||||
Set<IBinding> set;
|
Set<IBinding> set;
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
IBinding result= (IBinding) specializationMap.get(original);
|
IBinding result= (IBinding) specializationMap.get(original);
|
||||||
if (result != null)
|
if (result != null)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
set= fInProgress.get();
|
set= fInProgress.get();
|
||||||
if (set == null) {
|
if (set == null) {
|
||||||
set= new HashSet<IBinding>();
|
set= new HashSet<IBinding>();
|
||||||
fInProgress.set(set);
|
fInProgress.set(set);
|
||||||
}
|
}
|
||||||
if (!set.add(original))
|
if (!set.add(original))
|
||||||
return RecursionResolvingBinding.createFor(original, point);
|
return RecursionResolvingBinding.createFor(original, point);
|
||||||
}
|
}
|
||||||
|
|
||||||
IBinding result= CPPTemplates.createSpecialization(this, original, point);
|
IBinding result= CPPTemplates.createSpecialization(this, original, point);
|
||||||
set.remove(original);
|
set.remove(original);
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
IBinding concurrent= (IBinding) specializationMap.get(original);
|
IBinding concurrent= (IBinding) specializationMap.get(original);
|
||||||
if (concurrent != null)
|
if (concurrent != null)
|
||||||
return concurrent;
|
return concurrent;
|
||||||
if (specializationMap == ObjectMap.EMPTY_MAP)
|
if (specializationMap == ObjectMap.EMPTY_MAP)
|
||||||
specializationMap = new ObjectMap(2);
|
specializationMap = new ObjectMap(2);
|
||||||
|
@ -191,7 +191,7 @@ public class CPPClassSpecialization extends CPPSpecialization
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkForDefinition() {
|
public void checkForDefinition() {
|
||||||
// Ambiguity resolution ensures that declarations and definitions are resolved.
|
// Ambiguity resolution ensures that declarations and definitions are resolved.
|
||||||
|
@ -209,7 +209,7 @@ public class CPPClassSpecialization extends CPPSpecialization
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ICPPBase[] getBases() {
|
public ICPPBase[] getBases() {
|
||||||
CCorePlugin.log(new Exception("Unsafe method call. Instantiation of dependent expressions may not work.")); //$NON-NLS-1$
|
CCorePlugin.log(new Exception("Unsafe method call. Instantiation of dependent expressions may not work.")); //$NON-NLS-1$
|
||||||
|
@ -284,7 +284,7 @@ public class CPPClassSpecialization extends CPPSpecialization
|
||||||
|
|
||||||
return scope.getFriends(point);
|
return scope.getFriends(point);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ICPPClassType[] getNestedClasses() {
|
public ICPPClassType[] getNestedClasses() {
|
||||||
CCorePlugin.log(new Exception("Unsafe method call. Instantiation of dependent expressions may not work.")); //$NON-NLS-1$
|
CCorePlugin.log(new Exception("Unsafe method call. Instantiation of dependent expressions may not work.")); //$NON-NLS-1$
|
||||||
|
@ -345,7 +345,7 @@ public class CPPClassSpecialization extends CPPSpecialization
|
||||||
public int getKey() {
|
public int getKey() {
|
||||||
if (getDefinition() != null)
|
if (getDefinition() != null)
|
||||||
return getCompositeTypeSpecifier().getKey();
|
return getCompositeTypeSpecifier().getKey();
|
||||||
|
|
||||||
return getSpecializedBinding().getKey();
|
return getSpecializedBinding().getKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,24 +357,24 @@ public class CPPClassSpecialization extends CPPSpecialization
|
||||||
final ICPPClassScope specScope= getSpecializationScope();
|
final ICPPClassScope specScope= getSpecializationScope();
|
||||||
if (specScope != null)
|
if (specScope != null)
|
||||||
return specScope;
|
return specScope;
|
||||||
|
|
||||||
final ICPPASTCompositeTypeSpecifier typeSpecifier = getCompositeTypeSpecifier();
|
final ICPPASTCompositeTypeSpecifier typeSpecifier = getCompositeTypeSpecifier();
|
||||||
if (typeSpecifier != null)
|
if (typeSpecifier != null)
|
||||||
return typeSpecifier.getScope();
|
return typeSpecifier.getScope();
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ICPPClassSpecializationScope getSpecializationScope() {
|
protected ICPPClassSpecializationScope getSpecializationScope() {
|
||||||
checkForDefinition();
|
checkForDefinition();
|
||||||
if (getDefinition() != null)
|
if (getDefinition() != null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// Implicit specialization: must specialize bindings in scope.
|
// Implicit specialization: must specialize bindings in scope.
|
||||||
if (specScope == null) {
|
if (specScope == null) {
|
||||||
specScope = new CPPClassSpecializationScope(this);
|
specScope = new CPPClassSpecializationScope(this);
|
||||||
}
|
}
|
||||||
return specScope;
|
return specScope;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -397,10 +397,10 @@ public class CPPClassSpecialization extends CPPSpecialization
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAnonymous() {
|
public boolean isAnonymous() {
|
||||||
if (getNameCharArray().length > 0)
|
if (getNameCharArray().length > 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ICPPASTCompositeTypeSpecifier spec= getCompositeTypeSpecifier();
|
ICPPASTCompositeTypeSpecifier spec= getCompositeTypeSpecifier();
|
||||||
if (spec == null) {
|
if (spec == null) {
|
||||||
return getSpecializedBinding().isAnonymous();
|
return getSpecializedBinding().isAnonymous();
|
||||||
}
|
}
|
||||||
|
@ -416,23 +416,23 @@ public class CPPClassSpecialization extends CPPSpecialization
|
||||||
|
|
||||||
public static boolean isSameClassSpecialization(ICPPClassSpecialization t1, ICPPClassSpecialization t2) {
|
public static boolean isSameClassSpecialization(ICPPClassSpecialization t1, ICPPClassSpecialization t2) {
|
||||||
// Exclude class template specialization or class instance.
|
// Exclude class template specialization or class instance.
|
||||||
if (t2 instanceof ICPPTemplateInstance || t2 instanceof ICPPTemplateDefinition ||
|
if (t2 instanceof ICPPTemplateInstance || t2 instanceof ICPPTemplateDefinition ||
|
||||||
t2 instanceof IProblemBinding) {
|
t2 instanceof IProblemBinding) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t1.getKey() != t2.getKey())
|
if (t1.getKey() != t2.getKey())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!CharArrayUtils.equals(t1.getNameCharArray(), t2.getNameCharArray()))
|
if (!CharArrayUtils.equals(t1.getNameCharArray(), t2.getNameCharArray()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// The argument map is not significant for comparing specializations, the map is
|
// The argument map is not significant for comparing specializations, the map is
|
||||||
// determined by the owner of the specialization. This is different for instances,
|
// determined by the owner of the specialization. This is different for instances,
|
||||||
// which have a separate implementation for isSameType().
|
// which have a separate implementation for isSameType().
|
||||||
final IBinding owner1= t1.getOwner();
|
final IBinding owner1= t1.getOwner();
|
||||||
final IBinding owner2= t2.getOwner();
|
final IBinding owner2= t2.getOwner();
|
||||||
|
|
||||||
// For a specialization that is not an instance the owner has to be a class-type.
|
// For a specialization that is not an instance the owner has to be a class-type.
|
||||||
if (!(owner1 instanceof ICPPClassType) || !(owner2 instanceof ICPPClassType))
|
if (!(owner1 instanceof ICPPClassType) || !(owner2 instanceof ICPPClassType))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
* IBM Corporation
|
* IBM Corporation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.ui.wizards;
|
package org.eclipse.cdt.ui.wizards;
|
||||||
import java.net.URI;
|
|
||||||
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -53,446 +54,442 @@ import org.eclipse.cdt.ui.newui.PageLayout;
|
||||||
|
|
||||||
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 {
|
||||||
private static final Image IMG_CATEGORY = CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_SEARCHFOLDER);
|
private static final Image IMG_CATEGORY = CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_SEARCHFOLDER);
|
||||||
private static final Image IMG_ITEM = CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_VARIABLE);
|
private static final Image IMG_ITEM = CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_VARIABLE);
|
||||||
|
|
||||||
public static final String PAGE_ID = "org.eclipse.cdt.managedbuilder.ui.wizard.NewModelProjectWizardPage"; //$NON-NLS-1$
|
public static final String PAGE_ID = "org.eclipse.cdt.managedbuilder.ui.wizard.NewModelProjectWizardPage"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String EXTENSION_POINT_ID = "org.eclipse.cdt.ui.CDTWizard"; //$NON-NLS-1$
|
private static final String EXTENSION_POINT_ID = "org.eclipse.cdt.ui.CDTWizard"; //$NON-NLS-1$
|
||||||
private static final String ELEMENT_NAME = "wizard"; //$NON-NLS-1$
|
private static final String ELEMENT_NAME = "wizard"; //$NON-NLS-1$
|
||||||
private static final String CLASS_NAME = "class"; //$NON-NLS-1$
|
private static final String CLASS_NAME = "class"; //$NON-NLS-1$
|
||||||
public static final String DESC = "EntryDescriptor"; //$NON-NLS-1$
|
public static final String DESC = "EntryDescriptor"; //$NON-NLS-1$
|
||||||
|
|
||||||
// widgets
|
// Widgets
|
||||||
private Tree tree;
|
private Tree tree;
|
||||||
private Composite right;
|
private Composite right;
|
||||||
private Button show_sup;
|
private Button showSup;
|
||||||
private Label right_label;
|
private Label rightLabel;
|
||||||
|
|
||||||
public CWizardHandler h_selected = null;
|
public CWizardHandler h_selected;
|
||||||
private Label categorySelectedLabel;
|
private Label categorySelectedLabel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new project creation wizard page.
|
* Creates a new project creation wizard page.
|
||||||
*
|
*
|
||||||
* @param pageName the name of this page
|
* @param pageName the name of this page
|
||||||
*/
|
*/
|
||||||
public CDTMainWizardPage(String pageName) {
|
public CDTMainWizardPage(String pageName) {
|
||||||
super(pageName);
|
super(pageName);
|
||||||
setPageComplete(false);
|
setPageComplete(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** (non-Javadoc)
|
@Override
|
||||||
* Method declared on IDialogPage.
|
public void createControl(Composite parent) {
|
||||||
*/
|
super.createControl(parent);
|
||||||
@Override
|
|
||||||
public void createControl(Composite parent) {
|
|
||||||
super.createControl(parent);
|
|
||||||
|
|
||||||
createDynamicGroup((Composite)getControl());
|
createDynamicGroup((Composite)getControl());
|
||||||
switchTo(updateData(tree, right, show_sup, CDTMainWizardPage.this, getWizard()),
|
switchTo(updateData(tree, right, showSup, CDTMainWizardPage.this, getWizard()),
|
||||||
getDescriptor(tree));
|
getDescriptor(tree));
|
||||||
|
|
||||||
setPageComplete(validatePage());
|
setPageComplete(validatePage());
|
||||||
setErrorMessage(null);
|
setErrorMessage(null);
|
||||||
setMessage(null);
|
setMessage(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createDynamicGroup(Composite parent) {
|
private void createDynamicGroup(Composite parent) {
|
||||||
Composite c = new Composite(parent, SWT.NONE);
|
Composite c = new Composite(parent, SWT.NONE);
|
||||||
c.setLayoutData(new GridData(GridData.FILL_BOTH));
|
c.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||||
c.setLayout(new GridLayout(2, true));
|
c.setLayout(new GridLayout(2, true));
|
||||||
|
|
||||||
Label l1 = new Label(c, SWT.NONE);
|
Label l1 = new Label(c, SWT.NONE);
|
||||||
l1.setText(Messages.CMainWizardPage_0);
|
l1.setText(Messages.CMainWizardPage_0);
|
||||||
l1.setFont(parent.getFont());
|
l1.setFont(parent.getFont());
|
||||||
l1.setLayoutData(new GridData(GridData.BEGINNING));
|
l1.setLayoutData(new GridData(GridData.BEGINNING));
|
||||||
|
|
||||||
right_label = new Label(c, SWT.NONE);
|
rightLabel = new Label(c, SWT.NONE);
|
||||||
right_label.setFont(parent.getFont());
|
rightLabel.setFont(parent.getFont());
|
||||||
right_label.setLayoutData(new GridData(GridData.BEGINNING));
|
rightLabel.setLayoutData(new GridData(GridData.BEGINNING));
|
||||||
|
|
||||||
tree = new Tree(c, SWT.SINGLE | SWT.BORDER);
|
tree = new Tree(c, SWT.SINGLE | SWT.BORDER);
|
||||||
tree.setLayoutData(new GridData(GridData.FILL_BOTH));
|
tree.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||||
tree.addSelectionListener(new SelectionAdapter() {
|
tree.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
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((CWizardHandler)tis[0].getData(), (EntryDescriptor)tis[0].getData(DESC));
|
switchTo((CWizardHandler)tis[0].getData(), (EntryDescriptor)tis[0].getData(DESC));
|
||||||
setPageComplete(validatePage());
|
setPageComplete(validatePage());
|
||||||
}});
|
}});
|
||||||
tree.getAccessible().addAccessibleListener(
|
tree.getAccessible().addAccessibleListener(new AccessibleAdapter() {
|
||||||
new AccessibleAdapter() {
|
@Override
|
||||||
@Override
|
public void getName(AccessibleEvent e) {
|
||||||
public void getName(AccessibleEvent e) {
|
for (int i = 0; i < tree.getItemCount(); i++) {
|
||||||
for (int i = 0; i < tree.getItemCount(); i++) {
|
if (tree.getItem(i).getText().equals(e.result))
|
||||||
if (tree.getItem(i).getText().equals(e.result))
|
return;
|
||||||
return;
|
}
|
||||||
}
|
e.result = Messages.CMainWizardPage_0;
|
||||||
e.result = Messages.CMainWizardPage_0;
|
}});
|
||||||
}
|
right = new Composite(c, SWT.NONE);
|
||||||
}
|
right.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||||
);
|
right.setLayout(new PageLayout());
|
||||||
right = new Composite(c, SWT.NONE);
|
|
||||||
right.setLayoutData(new GridData(GridData.FILL_BOTH));
|
|
||||||
right.setLayout(new PageLayout());
|
|
||||||
|
|
||||||
show_sup = new Button(c, SWT.CHECK);
|
showSup = new Button(c, SWT.CHECK);
|
||||||
show_sup.setText(Messages.CMainWizardPage_1);
|
showSup.setText(Messages.CMainWizardPage_1);
|
||||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||||
gd.horizontalSpan = 2;
|
gd.horizontalSpan = 2;
|
||||||
show_sup.setLayoutData(gd);
|
showSup.setLayoutData(gd);
|
||||||
show_sup.addSelectionListener(new SelectionAdapter() {
|
showSup.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
if (h_selected != null)
|
if (h_selected != null)
|
||||||
h_selected.setSupportedOnly(show_sup.getSelection());
|
h_selected.setSupportedOnly(showSup.getSelection());
|
||||||
switchTo(updateData(tree, right, show_sup, CDTMainWizardPage.this, getWizard()),
|
switchTo(updateData(tree, right, showSup, CDTMainWizardPage.this, getWizard()),
|
||||||
getDescriptor(tree));
|
getDescriptor(tree));
|
||||||
}} );
|
}});
|
||||||
|
|
||||||
// restore settings from preferences
|
// restore settings from preferences
|
||||||
show_sup.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOSUPP));
|
showSup.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOSUPP));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IWizardPage getNextPage() {
|
public IWizardPage getNextPage() {
|
||||||
return (h_selected == null) ? null : h_selected.getSpecificPage();
|
return (h_selected == null) ? null : h_selected.getSpecificPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
public URI getProjectLocation() {
|
public URI getProjectLocation() {
|
||||||
return useDefaults() ? null : getLocationURI();
|
return useDefaults() ? null : getLocationURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this page's controls currently all contain valid
|
* Returns whether this page's controls currently all contain valid
|
||||||
* values.
|
* values.
|
||||||
*
|
*
|
||||||
* @return <code>true</code> if all controls are valid, and
|
* @return <code>true</code> if all controls are valid, and
|
||||||
* <code>false</code> if at least one is invalid
|
* <code>false</code> if at least one is invalid
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected boolean validatePage() {
|
protected boolean validatePage() {
|
||||||
setMessage(null);
|
setMessage(null);
|
||||||
if (!super.validatePage())
|
if (!super.validatePage())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (getProjectName().indexOf('#') >= 0) {
|
if (getProjectName().indexOf('#') >= 0) {
|
||||||
setErrorMessage(Messages.CDTMainWizardPage_0);
|
setErrorMessage(Messages.CDTMainWizardPage_0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean bad = true; // should we treat existing project as error
|
boolean bad = true; // should we treat existing project as error
|
||||||
|
|
||||||
IProject handle = getProjectHandle();
|
IProject handle = getProjectHandle();
|
||||||
if (handle.exists()) {
|
if (handle.exists()) {
|
||||||
if (getWizard() instanceof IWizardWithMemory) {
|
if (getWizard() instanceof IWizardWithMemory) {
|
||||||
IWizardWithMemory w = (IWizardWithMemory)getWizard();
|
IWizardWithMemory w = (IWizardWithMemory)getWizard();
|
||||||
if (w.getLastProjectName() != null && w.getLastProjectName().equals(getProjectName()))
|
if (w.getLastProjectName() != null && w.getLastProjectName().equals(getProjectName()))
|
||||||
bad = false;
|
bad = false;
|
||||||
}
|
}
|
||||||
if (bad) {
|
if (bad) {
|
||||||
setErrorMessage(Messages.CMainWizardPage_10);
|
setErrorMessage(Messages.CMainWizardPage_10);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bad) { // skip this check if project already created
|
if (bad) { // Skip this check if project already created
|
||||||
try {
|
try {
|
||||||
IFileStore fs;
|
IFileStore fs;
|
||||||
URI p = getProjectLocation();
|
URI p = getProjectLocation();
|
||||||
if (p == null) {
|
if (p == null) {
|
||||||
fs = EFS.getStore(ResourcesPlugin.getWorkspace().getRoot().getLocationURI());
|
fs = EFS.getStore(ResourcesPlugin.getWorkspace().getRoot().getLocationURI());
|
||||||
fs = fs.getChild(getProjectName());
|
fs = fs.getChild(getProjectName());
|
||||||
} else
|
} else
|
||||||
fs = EFS.getStore(p);
|
fs = EFS.getStore(p);
|
||||||
IFileInfo f = fs.fetchInfo();
|
IFileInfo f = fs.fetchInfo();
|
||||||
if (f.exists()) {
|
if (f.exists()) {
|
||||||
if (f.isDirectory()) {
|
if (f.isDirectory()) {
|
||||||
if (f.getAttribute(EFS.ATTRIBUTE_READ_ONLY)) {
|
if (f.getAttribute(EFS.ATTRIBUTE_READ_ONLY)) {
|
||||||
setErrorMessage(Messages.CMainWizardPage_DirReadOnlyError);
|
setErrorMessage(Messages.CMainWizardPage_DirReadOnlyError);
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
else
|
|
||||||
setMessage(Messages.CMainWizardPage_7, IMessageProvider.WARNING);
|
|
||||||
} else {
|
|
||||||
setErrorMessage(Messages.CMainWizardPage_6);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (CoreException e) {
|
|
||||||
CUIPlugin.log(e.getStatus());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!useDefaults()) {
|
|
||||||
IStatus locationStatus = ResourcesPlugin.getWorkspace().validateProjectLocationURI(handle,
|
|
||||||
getLocationURI());
|
|
||||||
if (!locationStatus.isOK()) {
|
|
||||||
setErrorMessage(locationStatus.getMessage());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tree.getItemCount() == 0) {
|
|
||||||
setErrorMessage(Messages.CMainWizardPage_3);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// it is not an error, but we cannot continue
|
|
||||||
if (h_selected == null) {
|
|
||||||
setErrorMessage(null);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String s = h_selected.getErrorMessage();
|
|
||||||
if (s != null) {
|
|
||||||
setErrorMessage(s);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
setErrorMessage(null);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param tree
|
|
||||||
* @param right
|
|
||||||
* @param show_sup
|
|
||||||
* @param ls
|
|
||||||
* @param wizard
|
|
||||||
* @return : selected Wizard Handler.
|
|
||||||
*/
|
|
||||||
public static CWizardHandler updateData(Tree tree, Composite right, Button show_sup, IWizardItemsListListener ls, IWizard wizard) {
|
|
||||||
// remember selected item
|
|
||||||
TreeItem[] selection = tree.getSelection();
|
|
||||||
TreeItem selectedItem = selection.length>0 ? selection[0] : null;
|
|
||||||
String savedLabel = selectedItem!=null ? selectedItem.getText() : null;
|
|
||||||
String savedParentLabel = getParentText(selectedItem);
|
|
||||||
|
|
||||||
tree.removeAll();
|
|
||||||
IExtensionPoint extensionPoint =
|
|
||||||
Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_ID);
|
|
||||||
if (extensionPoint == null) return null;
|
|
||||||
IExtension[] extensions = extensionPoint.getExtensions();
|
|
||||||
if (extensions == null) return null;
|
|
||||||
|
|
||||||
List<EntryDescriptor> items = new ArrayList<EntryDescriptor>();
|
|
||||||
for (int i = 0; i < extensions.length; ++i) {
|
|
||||||
IConfigurationElement[] elements = extensions[i].getConfigurationElements();
|
|
||||||
for (IConfigurationElement element : elements) {
|
|
||||||
if (element.getName().equals(ELEMENT_NAME)) {
|
|
||||||
CNewWizard w = null;
|
|
||||||
try {
|
|
||||||
w = (CNewWizard) element.createExecutableExtension(CLASS_NAME);
|
|
||||||
} catch (CoreException e) {
|
|
||||||
System.out.println(Messages.CMainWizardPage_5 + e.getLocalizedMessage());
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
if (w == null) return null;
|
else
|
||||||
w.setDependentControl(right, ls);
|
setMessage(Messages.CMainWizardPage_7, IMessageProvider.WARNING);
|
||||||
for (EntryDescriptor ed : w.createItems(show_sup.getSelection(), wizard))
|
} else {
|
||||||
items.add(ed);
|
setErrorMessage(Messages.CMainWizardPage_6);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (CoreException e) {
|
||||||
|
CUIPlugin.log(e.getStatus());
|
||||||
}
|
}
|
||||||
// If there is a EntryDescriptor which is default for category, make sure it
|
}
|
||||||
// is in the front of the list.
|
|
||||||
for (int i = 0; i < items.size(); ++i)
|
if (!useDefaults()) {
|
||||||
{
|
IStatus locationStatus =
|
||||||
EntryDescriptor ed = items.get(i);
|
ResourcesPlugin.getWorkspace().validateProjectLocationURI(handle, getLocationURI());
|
||||||
if (ed.isDefaultForCategory())
|
if (!locationStatus.isOK()) {
|
||||||
{
|
setErrorMessage(locationStatus.getMessage());
|
||||||
items.remove(i);
|
return false;
|
||||||
items.add(0, ed);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// bug # 211935 : allow items filtering.
|
if (tree.getItemCount() == 0) {
|
||||||
if (ls != null) // NULL means call from prefs
|
setErrorMessage(Messages.CMainWizardPage_3);
|
||||||
items = ls.filterItems(items);
|
return false;
|
||||||
addItemsToTree(tree, items);
|
}
|
||||||
|
|
||||||
if (tree.getItemCount() > 0) {
|
// it is not an error, but we cannot continue
|
||||||
TreeItem target = null;
|
if (h_selected == null) {
|
||||||
// try to search item which was selected before
|
setErrorMessage(null);
|
||||||
if (savedLabel != null) {
|
return false;
|
||||||
target = findItem(tree, savedLabel, savedParentLabel);
|
}
|
||||||
}
|
|
||||||
if (target == null) {
|
String s = h_selected.getErrorMessage();
|
||||||
// Default selection associated with "org.eclipse.cdt.build.core.buildArtefactType.exe" project type
|
if (s != null) {
|
||||||
target = findItem(tree, Messages.CDTMainWizardPage_DefaultProjectType, Messages.CDTMainWizardPage_DefaultProjectCategory);
|
setErrorMessage(s);
|
||||||
if (target == null) {
|
return false;
|
||||||
CUIPlugin.log(new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, "Default project not found in New C/C++ Project Wizard")); //$NON-NLS-1$
|
}
|
||||||
|
|
||||||
|
setErrorMessage(null);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param tree
|
||||||
|
* @param right
|
||||||
|
* @param show_sup
|
||||||
|
* @param ls
|
||||||
|
* @param wizard
|
||||||
|
* @return : selected Wizard Handler.
|
||||||
|
*/
|
||||||
|
public static CWizardHandler updateData(Tree tree, Composite right, Button show_sup,
|
||||||
|
IWizardItemsListListener ls, IWizard wizard) {
|
||||||
|
// Remember selected item
|
||||||
|
TreeItem[] selection = tree.getSelection();
|
||||||
|
TreeItem selectedItem = selection.length > 0 ? selection[0] : null;
|
||||||
|
String savedLabel = selectedItem != null ? selectedItem.getText() : null;
|
||||||
|
String savedParentLabel = getParentText(selectedItem);
|
||||||
|
|
||||||
|
tree.removeAll();
|
||||||
|
IExtensionPoint extensionPoint =
|
||||||
|
Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_ID);
|
||||||
|
if (extensionPoint == null) return null;
|
||||||
|
IExtension[] extensions = extensionPoint.getExtensions();
|
||||||
|
if (extensions == null) return null;
|
||||||
|
|
||||||
|
List<EntryDescriptor> items = new ArrayList<EntryDescriptor>();
|
||||||
|
for (int i = 0; i < extensions.length; ++i) {
|
||||||
|
IConfigurationElement[] elements = extensions[i].getConfigurationElements();
|
||||||
|
for (IConfigurationElement element : elements) {
|
||||||
|
if (element.getName().equals(ELEMENT_NAME)) {
|
||||||
|
CNewWizard w = null;
|
||||||
|
try {
|
||||||
|
w = (CNewWizard) element.createExecutableExtension(CLASS_NAME);
|
||||||
|
} catch (CoreException e) {
|
||||||
|
System.out.println(Messages.CMainWizardPage_5 + e.getLocalizedMessage());
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
if (w == null)
|
||||||
|
return null;
|
||||||
|
w.setDependentControl(right, ls);
|
||||||
|
for (EntryDescriptor ed : w.createItems(show_sup.getSelection(), wizard))
|
||||||
|
items.add(ed);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If there is a EntryDescriptor which is default for category, make sure it
|
||||||
|
// is in the front of the list.
|
||||||
|
for (int i = 0; i < items.size(); ++i) {
|
||||||
|
EntryDescriptor ed = items.get(i);
|
||||||
|
if (ed.isDefaultForCategory()) {
|
||||||
|
items.remove(i);
|
||||||
|
items.add(0, ed);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// bug # 211935 : allow items filtering.
|
||||||
|
if (ls != null) // NULL means call from prefs
|
||||||
|
items = ls.filterItems(items);
|
||||||
|
addItemsToTree(tree, items);
|
||||||
|
|
||||||
|
if (tree.getItemCount() > 0) {
|
||||||
|
TreeItem target = null;
|
||||||
|
// Try to search item which was selected before
|
||||||
|
if (savedLabel != null) {
|
||||||
|
target = findItem(tree, savedLabel, savedParentLabel);
|
||||||
|
}
|
||||||
|
if (target == null) {
|
||||||
|
// Default selection associated with "org.eclipse.cdt.build.core.buildArtefactType.exe" project type
|
||||||
|
target = findItem(tree, Messages.CDTMainWizardPage_DefaultProjectType,
|
||||||
|
Messages.CDTMainWizardPage_DefaultProjectCategory);
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
target = tree.getItem(0);
|
CUIPlugin.log(new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID,
|
||||||
if (target.getItemCount() != 0)
|
"Default project not found in New C/C++ Project Wizard")); //$NON-NLS-1$
|
||||||
target = target.getItem(0);
|
|
||||||
}
|
}
|
||||||
tree.setSelection(target);
|
|
||||||
return (CWizardHandler)target.getData();
|
|
||||||
}
|
}
|
||||||
return null;
|
if (target == null) {
|
||||||
}
|
target = tree.getItem(0);
|
||||||
|
if (target.getItemCount() != 0)
|
||||||
private static String getParentText(TreeItem item) {
|
target = target.getItem(0);
|
||||||
if (item==null || item.getParentItem()==null)
|
|
||||||
return ""; //$NON-NLS-1$
|
|
||||||
return item.getParentItem().getText();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static TreeItem findItem(Tree tree, String label, String parentLabel) {
|
|
||||||
for (TreeItem item : tree.getItems()) {
|
|
||||||
TreeItem foundItem = findTreeItem(item, label, parentLabel);
|
|
||||||
if (foundItem!=null)
|
|
||||||
return foundItem;
|
|
||||||
}
|
}
|
||||||
return null;
|
tree.setSelection(target);
|
||||||
|
return (CWizardHandler)target.getData();
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private static TreeItem findTreeItem(TreeItem item, String label, String parentLabel) {
|
private static String getParentText(TreeItem item) {
|
||||||
if (item.getText().equals(label) && getParentText(item).equals(parentLabel))
|
if (item == null || item.getParentItem() == null)
|
||||||
return item;
|
return ""; //$NON-NLS-1$
|
||||||
|
return item.getParentItem().getText();
|
||||||
|
}
|
||||||
|
|
||||||
for (TreeItem child : item.getItems()) {
|
private static TreeItem findItem(Tree tree, String label, String parentLabel) {
|
||||||
TreeItem foundItem = findTreeItem(child, label, parentLabel);
|
for (TreeItem item : tree.getItems()) {
|
||||||
if (foundItem!=null)
|
TreeItem foundItem = findTreeItem(item, label, parentLabel);
|
||||||
return foundItem;
|
if (foundItem!=null)
|
||||||
}
|
return foundItem;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private static void addItemsToTree(Tree tree, List<EntryDescriptor> items) {
|
private static TreeItem findTreeItem(TreeItem item, String label, String parentLabel) {
|
||||||
|
if (item.getText().equals(label) && getParentText(item).equals(parentLabel))
|
||||||
|
return item;
|
||||||
|
|
||||||
|
for (TreeItem child : item.getItems()) {
|
||||||
|
TreeItem foundItem = findTreeItem(child, label, parentLabel);
|
||||||
|
if (foundItem!=null)
|
||||||
|
return foundItem;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void addItemsToTree(Tree tree, List<EntryDescriptor> items) {
|
||||||
// Sorting is disabled because of users requests
|
// Sorting is disabled because of users requests
|
||||||
// Collections.sort(items, CDTListComparator.getInstance());
|
// Collections.sort(items, CDTListComparator.getInstance());
|
||||||
|
|
||||||
ArrayList<TreeItem> placedTreeItemsList = new ArrayList<TreeItem>(items.size());
|
ArrayList<TreeItem> placedTreeItemsList = new ArrayList<TreeItem>(items.size());
|
||||||
ArrayList<EntryDescriptor> placedEntryDescriptorsList = new ArrayList<EntryDescriptor>(items.size());
|
ArrayList<EntryDescriptor> placedEntryDescriptorsList = new ArrayList<EntryDescriptor>(items.size());
|
||||||
for (EntryDescriptor wd : items) {
|
for (EntryDescriptor wd : items) {
|
||||||
if (wd.getParentId() == null) {
|
if (wd.getParentId() == null) {
|
||||||
wd.setPath(wd.getId());
|
wd.setPath(wd.getId());
|
||||||
TreeItem ti = new TreeItem(tree, SWT.NONE);
|
TreeItem ti = new TreeItem(tree, SWT.NONE);
|
||||||
ti.setText(TextProcessor.process(wd.getName()));
|
ti.setText(TextProcessor.process(wd.getName()));
|
||||||
ti.setData(wd.getHandler());
|
ti.setData(wd.getHandler());
|
||||||
ti.setData(DESC, wd);
|
ti.setData(DESC, wd);
|
||||||
ti.setImage(calcImage(wd));
|
ti.setImage(calcImage(wd));
|
||||||
placedTreeItemsList.add(ti);
|
placedTreeItemsList.add(ti);
|
||||||
placedEntryDescriptorsList.add(wd);
|
placedEntryDescriptorsList.add(wd);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
while(true) {
|
}
|
||||||
boolean found = false;
|
while (true) {
|
||||||
Iterator<EntryDescriptor> it2 = items.iterator();
|
boolean found = false;
|
||||||
while (it2.hasNext()) {
|
Iterator<EntryDescriptor> it2 = items.iterator();
|
||||||
EntryDescriptor wd1 = it2.next();
|
while (it2.hasNext()) {
|
||||||
if (wd1.getParentId() == null) continue;
|
EntryDescriptor wd1 = it2.next();
|
||||||
for (int i = 0; i< placedEntryDescriptorsList.size(); i++) {
|
if (wd1.getParentId() == null) continue;
|
||||||
EntryDescriptor wd2 = placedEntryDescriptorsList.get(i);
|
for (int i = 0; i < placedEntryDescriptorsList.size(); i++) {
|
||||||
if (wd2.getId().equals(wd1.getParentId())) {
|
EntryDescriptor wd2 = placedEntryDescriptorsList.get(i);
|
||||||
found = true;
|
if (wd2.getId().equals(wd1.getParentId())) {
|
||||||
wd1.setParentId(null);
|
found = true;
|
||||||
CWizardHandler h = wd2.getHandler();
|
wd1.setParentId(null);
|
||||||
/* If neither wd1 itself, nor its parent (wd2) have a handler
|
CWizardHandler h = wd2.getHandler();
|
||||||
* associated with them, and the item is not a category,
|
/* If neither wd1 itself, nor its parent (wd2) have a handler
|
||||||
* then skip it. If it's category, then it's possible that
|
* associated with them, and the item is not a category,
|
||||||
* children will have a handler associated with them.
|
* then skip it. If it's category, then it's possible that
|
||||||
*/
|
* children will have a handler associated with them.
|
||||||
if (h == null && wd1.getHandler() == null && !wd1.isCategory())
|
*/
|
||||||
break;
|
if (h == null && wd1.getHandler() == null && !wd1.isCategory())
|
||||||
|
|
||||||
wd1.setPath(wd2.getPath() + "/" + wd1.getId()); //$NON-NLS-1$
|
|
||||||
wd1.setParent(wd2);
|
|
||||||
if (h != null) {
|
|
||||||
if (wd1.getHandler() == null && !wd1.isCategory())
|
|
||||||
wd1.setHandler((CWizardHandler)h.clone());
|
|
||||||
if (!h.isApplicable(wd1))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
TreeItem p = placedTreeItemsList.get(i);
|
|
||||||
TreeItem ti = new TreeItem(p, SWT.NONE);
|
|
||||||
ti.setText(wd1.getName());
|
|
||||||
ti.setData(wd1.getHandler());
|
|
||||||
ti.setData(DESC, wd1);
|
|
||||||
ti.setImage(calcImage(wd1));
|
|
||||||
placedTreeItemsList.add(ti);
|
|
||||||
placedEntryDescriptorsList.add(wd1);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
wd1.setPath(wd2.getPath() + "/" + wd1.getId()); //$NON-NLS-1$
|
||||||
|
wd1.setParent(wd2);
|
||||||
|
if (h != null) {
|
||||||
|
if (wd1.getHandler() == null && !wd1.isCategory())
|
||||||
|
wd1.setHandler((CWizardHandler)h.clone());
|
||||||
|
if (!h.isApplicable(wd1))
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TreeItem p = placedTreeItemsList.get(i);
|
||||||
|
TreeItem ti = new TreeItem(p, SWT.NONE);
|
||||||
|
ti.setText(wd1.getName());
|
||||||
|
ti.setData(wd1.getHandler());
|
||||||
|
ti.setData(DESC, wd1);
|
||||||
|
ti.setImage(calcImage(wd1));
|
||||||
|
placedTreeItemsList.add(ti);
|
||||||
|
placedEntryDescriptorsList.add(wd1);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// repeat iterations until all items are placed.
|
|
||||||
if (!found) break;
|
|
||||||
}
|
}
|
||||||
// orphan elements (with not-existing parentId) are ignored
|
// repeat iterations until all items are placed.
|
||||||
|
if (!found) break;
|
||||||
}
|
}
|
||||||
|
// orphan elements (with not-existing parentId) are ignored
|
||||||
|
}
|
||||||
|
|
||||||
private void switchTo(CWizardHandler h, EntryDescriptor ed) {
|
private void switchTo(CWizardHandler h, EntryDescriptor ed) {
|
||||||
if (h == null)
|
if (h == null)
|
||||||
h = ed.getHandler();
|
h = ed.getHandler();
|
||||||
if (ed.isCategory())
|
if (ed.isCategory())
|
||||||
h = null;
|
h = null;
|
||||||
try {
|
try {
|
||||||
if (h != null)
|
if (h != null)
|
||||||
h.initialize(ed);
|
h.initialize(ed);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
h = null;
|
h = null;
|
||||||
}
|
}
|
||||||
if (h_selected != null)
|
if (h_selected != null)
|
||||||
h_selected.handleUnSelection();
|
h_selected.handleUnSelection();
|
||||||
h_selected = h;
|
h_selected = h;
|
||||||
if (h == null) {
|
if (h == null) {
|
||||||
if (ed.isCategory()) {
|
if (ed.isCategory()) {
|
||||||
if (categorySelectedLabel == null) {
|
if (categorySelectedLabel == null) {
|
||||||
categorySelectedLabel = new Label(right, SWT.WRAP);
|
categorySelectedLabel = new Label(right, SWT.WRAP);
|
||||||
categorySelectedLabel.setText(
|
categorySelectedLabel.setText(Messages.CDTMainWizardPage_1);
|
||||||
Messages.CDTMainWizardPage_1);
|
right.layout();
|
||||||
right.layout();
|
|
||||||
}
|
|
||||||
categorySelectedLabel.setVisible(true);
|
|
||||||
}
|
}
|
||||||
return;
|
categorySelectedLabel.setVisible(true);
|
||||||
}
|
}
|
||||||
right_label.setText(h_selected.getHeader());
|
return;
|
||||||
if (categorySelectedLabel != null)
|
|
||||||
categorySelectedLabel.setVisible(false);
|
|
||||||
h_selected.handleSelection();
|
|
||||||
h_selected.setSupportedOnly(show_sup.getSelection());
|
|
||||||
}
|
}
|
||||||
|
rightLabel.setText(h_selected.getHeader());
|
||||||
|
if (categorySelectedLabel != null)
|
||||||
|
categorySelectedLabel.setVisible(false);
|
||||||
|
h_selected.handleSelection();
|
||||||
|
h_selected.setSupportedOnly(showSup.getSelection());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static EntryDescriptor getDescriptor(Tree _tree) {
|
public static EntryDescriptor getDescriptor(Tree tree) {
|
||||||
TreeItem[] sel = _tree.getSelection();
|
TreeItem[] sel = tree.getSelection();
|
||||||
if (sel == null || sel.length == 0)
|
if (sel == null || sel.length == 0)
|
||||||
return null;
|
return null;
|
||||||
return (EntryDescriptor)sel[0].getData(DESC);
|
return (EntryDescriptor)sel[0].getData(DESC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toolChainListChanged(int count) {
|
public void toolChainListChanged(int count) {
|
||||||
setPageComplete(validatePage());
|
setPageComplete(validatePage());
|
||||||
getWizard().getContainer().updateButtons();
|
getWizard().getContainer().updateButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCurrent() { return isCurrentPage(); }
|
public boolean isCurrent() {
|
||||||
|
return isCurrentPage();
|
||||||
|
}
|
||||||
|
|
||||||
private static Image calcImage(EntryDescriptor ed) {
|
private static Image calcImage(EntryDescriptor ed) {
|
||||||
if (ed.getImage() != null) return ed.getImage();
|
if (ed.getImage() != null) return ed.getImage();
|
||||||
if (ed.isCategory()) return IMG_CATEGORY;
|
if (ed.isCategory()) return IMG_CATEGORY;
|
||||||
return IMG_ITEM;
|
return IMG_ITEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
public List filterItems(List items) {
|
public List filterItems(List items) {
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue