mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 18:05:33 +02:00
Bug # 211935 : Cannot customize CDTMainWizardPage because of key methods being "private"/ "static"
This commit is contained in:
parent
8f1b9f6726
commit
4834d59667
3 changed files with 36 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue