import java.util.StringTokenizer;
import java.util.TreeSet;
-import net.sourceforge.phpdt.core.IJavaModel;
+//import net.sourceforge.phpdt.core.IJavaModel;
import net.sourceforge.phpdt.internal.ui.PHPUiImages;
import net.sourceforge.phpdt.internal.ui.filters.CustomFiltersDialog;
import net.sourceforge.phpdt.internal.ui.filters.FilterDescriptor;
//incastrix
//import org.eclipse.jface.text.Assert;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
+//import org.eclipse.jface.viewers.IContentProvider;
+//import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IViewPart;
+//import org.eclipse.ui.IViewPart;
import org.eclipse.ui.actions.ActionGroup;
/**
* @param viewer
* the viewer to be filtered
*/
- public CustomFiltersActionGroup(IViewPart part, StructuredViewer viewer) {
- this(part.getViewSite().getId(), viewer);
- }
+// public CustomFiltersActionGroup(IViewPart part, StructuredViewer viewer) {
+// this(part.getViewSite().getId(), viewer);
+// }
/**
* Creates a new <code>CustomFiltersActionGroup</code>.
fillViewMenu(actionBars.getMenuManager());
}
- public String[] removeFiltersFor(Object parent, Object element,
- IContentProvider contentProvider) {
- String[] enabledFilters = getEnabledFilterIds();
- Set newFilters = new HashSet();
- for (int i = 0; i < enabledFilters.length; i++) {
- String filterName = enabledFilters[i];
- ViewerFilter filter = (ViewerFilter) fInstalledBuiltInFilters
- .get(filterName);
- if (filter == null)
- newFilters.add(filterName);
- else if (isSelected(parent, element, contentProvider, filter))
- newFilters.add(filterName);
- }
- if (newFilters.size() == enabledFilters.length)
- return new String[0];
- return (String[]) newFilters.toArray(new String[newFilters.size()]);
- }
+// public String[] removeFiltersFor(Object parent, Object element,
+// IContentProvider contentProvider) {
+// String[] enabledFilters = getEnabledFilterIds();
+// Set newFilters = new HashSet();
+// for (int i = 0; i < enabledFilters.length; i++) {
+// String filterName = enabledFilters[i];
+// ViewerFilter filter = (ViewerFilter) fInstalledBuiltInFilters
+// .get(filterName);
+// if (filter == null)
+// newFilters.add(filterName);
+// else if (isSelected(parent, element, contentProvider, filter))
+// newFilters.add(filterName);
+// }
+// if (newFilters.size() == enabledFilters.length)
+// return new String[0];
+// return (String[]) newFilters.toArray(new String[newFilters.size()]);
+// }
public void setFilters(String[] newFilters) {
setEnabledFilterIds(newFilters);
updateViewerFilters(true);
}
- private boolean isSelected(Object parent, Object element,
- IContentProvider contentProvider, ViewerFilter filter) {
- if (contentProvider instanceof ITreeContentProvider) {
- // the element and all its parents have to be selected
- ITreeContentProvider provider = (ITreeContentProvider) contentProvider;
- while (element != null && !(element instanceof IJavaModel)) {
- if (!filter.select(fViewer, parent, element))
- return false;
- element = provider.getParent(element);
- }
- return true;
- }
- return filter.select(fViewer, parent, element);
- }
+// private boolean isSelected(Object parent, Object element,
+// IContentProvider contentProvider, ViewerFilter filter) {
+// if (contentProvider instanceof ITreeContentProvider) {
+// // the element and all its parents have to be selected
+// ITreeContentProvider provider = (ITreeContentProvider) contentProvider;
+// while (element != null && !(element instanceof IJavaModel)) {
+// if (!filter.select(fViewer, parent, element))
+// return false;
+// element = provider.getParent(element);
+// }
+// return true;
+// }
+// return filter.select(fViewer, parent, element);
+// }
/**
* Sets the enable state of the given filter.
//import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import net.sourceforge.phpeclipse.ui.WebUI;
-import org.eclipse.jface.action.IMenuManager;
+//import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.preference.IPreferenceStore;
//incastrix
* the menu manager to which the actions are added
* @since 2.1
*/
- public void contributeToViewMenu(IMenuManager menu) {
- if (!fInViewMenu)
- return;
- final String filters = "filters"; //$NON-NLS-1$
- if (menu.find(filters) != null) {
- menu.prependToGroup(filters, fFilterActions[0]); // fields
- menu.prependToGroup(filters, fFilterActions[1]); // static
- menu.prependToGroup(filters, fFilterActions[2]); // public
- } else {
- menu.add(fFilterActions[0]); // fields
- menu.add(fFilterActions[1]); // static
- menu.add(fFilterActions[2]); // public
- }
- }
+// public void contributeToViewMenu(IMenuManager menu) {
+// if (!fInViewMenu)
+// return;
+// final String filters = "filters"; //$NON-NLS-1$
+// if (menu.find(filters) != null) {
+// menu.prependToGroup(filters, fFilterActions[0]); // fields
+// menu.prependToGroup(filters, fFilterActions[1]); // static
+// menu.prependToGroup(filters, fFilterActions[2]); // public
+// } else {
+// menu.add(fFilterActions[0]); // fields
+// menu.add(fFilterActions[1]); // static
+// menu.add(fFilterActions[2]); // public
+// }
+// }
/*
* (non-Javadoc)
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IViewPart;
+//import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.actions.OpenWithMenu;
* @param part
* the view part that owns this action group
*/
- public OpenEditorActionGroup(IViewPart part) {
- fSite = part.getSite();
- fOpen = new PHPOpenDeclarationAction(fSite);
- fOpen.setActionDefinitionId(PHPEditorActionDefinitionIds.OPEN_EDITOR);
- initialize(fSite.getSelectionProvider());
- }
+// public OpenEditorActionGroup(IViewPart part) {
+// fSite = part.getSite();
+// fOpen = new PHPOpenDeclarationAction(fSite);
+// fOpen.setActionDefinitionId(PHPEditorActionDefinitionIds.OPEN_EDITOR);
+// initialize(fSite.getSelectionProvider());
+// }
/**
* Note: This constructor is for internal use only. Clients should not call
* @return the open action. Returns <code>null</code> if the group doesn't
* provide any open action
*/
- public IAction getOpenAction() {
- return fOpen;
- }
+// public IAction getOpenAction() {
+// return fOpen;
+// }
private void initialize(ISelectionProvider provider) {
ISelection selection = provider.getSelection();