diff --git a/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/TestCProjectPlatformPage.java b/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/TestCProjectPlatformPage.java index 9a2f7c709eb..aaf746a5eae 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/TestCProjectPlatformPage.java +++ b/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/TestCProjectPlatformPage.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.cdt.managedbuilder.ui.tests; +import java.util.List; + import junit.framework.TestCase; import org.eclipse.cdt.core.parser.util.ArrayUtil; @@ -20,7 +22,6 @@ import org.eclipse.cdt.ui.wizards.CDTProjectWizard; import org.eclipse.cdt.ui.wizards.CWizardHandler; import org.eclipse.cdt.ui.wizards.IWizardItemsListListener; import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Shell; @@ -79,7 +80,8 @@ public class TestCProjectPlatformPage extends TestCase implements IWizardItemsLi /* Test the new page, create page, set selection lifecycle. */ public void testProject() throws Exception { - IPath p = ResourcesPlugin.getWorkspace().getRoot().getLocation(); + //IPath p = + ResourcesPlugin.getWorkspace().getRoot().getLocation(); /* NewModelProjectWizard wiz = new CDTProjectWizard(); /* @@ -133,9 +135,16 @@ public class TestCProjectPlatformPage extends TestCase implements IWizardItemsLi // TODO Auto-generated method stub } + public List filterItems(List items) { + return items; + } } // methods of IToolChainListListener public boolean isCurrent() { return currentState; } public void toolChainListChanged(int count) {} + + public List filterItems(List items) { + return items; + } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTMainWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTMainWizardPage.java index 4a144f66969..73c61d90c48 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTMainWizardPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTMainWizardPage.java @@ -13,6 +13,7 @@ package org.eclipse.cdt.ui.wizards; import java.io.File; import java.util.ArrayList; import java.util.Iterator; +import java.util.List; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; @@ -276,6 +277,9 @@ import org.eclipse.cdt.internal.ui.CPluginImages; } } + // bug # 211935 : allow items filtering. + if (ls != null) // NULL means call from prefs + ls.filterItems(items); addItemsToTree(tree, items); if (tree.getItemCount() > 0) { @@ -396,5 +400,9 @@ import org.eclipse.cdt.internal.ui.CPluginImages; if (ed.isCategory()) return IMG_CATEGORY; return IMG_ITEM; } + + public List filterItems(List items) { + return items; + } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/IWizardItemsListListener.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/IWizardItemsListListener.java index 0f20b9efa2a..bc8e76b6625 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/IWizardItemsListListener.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/IWizardItemsListListener.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.cdt.ui.wizards; +import java.util.List; + /** * Interface should be implemented by some visible object * (usually - 1st page in CDT New Project wizard) @@ -29,4 +31,19 @@ public interface IWizardItemsListListener { * @return true if this page is visible */ boolean isCurrent(); + + /** + * Ability to filter items which would be shown + * in the left pane of Main Wizard Page. + * Standard implementation: return unchanged list. + * When filtering, please note : + * - Each item has {@link}EntryDescriptor type + * - Items have hierarchical relations with others, + * so removing some item(s) can break a tree. + * + * @param items - list of EntryDescriptor objects + * @return - list with filtered items + */ + List filterItems(List items); + }