1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 15:45:25 +02:00

[174479] Move remote search page to package org.eclipse.rse.internal.files.ui.search.

This commit is contained in:
Kushal Munir 2007-02-16 18:23:48 +00:00
parent 3a57443741
commit c723286c48
7 changed files with 1 additions and 1706 deletions

View file

@ -91,7 +91,6 @@ org.eclipse.rse.files.ui.compare
org.eclipse.rse.files.ui.dialogs
org.eclipse.rse.files.ui.propertypages
org.eclipse.rse.files.ui.resources
org.eclipse.rse.files.ui.search
org.eclipse.rse.files.ui.view
org.eclipse.rse.files.ui.widgets
org.eclipse.rse.files.ui.wizards

View file

@ -158,7 +158,6 @@
<topic label="org.eclipse.rse.files.ui.dialogs" href="reference/api/org/eclipse/rse/files/ui/dialogs/package-summary.html"/>
<topic label="org.eclipse.rse.files.ui.propertypages" href="reference/api/org/eclipse/rse/files/ui/propertypages/package-summary.html"/>
<topic label="org.eclipse.rse.files.ui.resources" href="reference/api/org/eclipse/rse/files/ui/resources/package-summary.html"/>
<topic label="org.eclipse.rse.files.ui.search" href="reference/api/org/eclipse/rse/files/ui/search/package-summary.html"/>
<topic label="org.eclipse.rse.files.ui.view" href="reference/api/org/eclipse/rse/files/ui/view/package-summary.html"/>
<topic label="org.eclipse.rse.files.ui.widgets" href="reference/api/org/eclipse/rse/files/ui/widgets/package-summary.html"/>
<topic label="org.eclipse.rse.files.ui.wizards" href="reference/api/org/eclipse/rse/files/ui/wizards/package-summary.html"/>

View file

@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
* Copyright (c) 2002, 2007 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html

View file

@ -1,62 +0,0 @@
/********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
********************************************************************************/
package org.eclipse.rse.files.ui.search;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.search.ui.NewSearchUI;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
public class SystemOpenSearchPageAction implements IWorkbenchWindowActionDelegate {
private IWorkbenchWindow window;
/**
* Constructor for open remote search page action.
*/
public SystemOpenSearchPageAction() {
super();
}
/**
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
*/
public void dispose() {
}
/**
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
public void init(IWorkbenchWindow window) {
this.window = window;
}
/**
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
public void run(IAction action) {
NewSearchUI.openSearchDialog(window, SystemSearchPage.SYSTEM_SEARCH_PAGE_ID);
}
/**
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
}
}

View file

@ -1,47 +0,0 @@
/********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
********************************************************************************/
package org.eclipse.rse.files.ui.search;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.rse.files.ui.actions.SystemSelectFileTypesAction;
import org.eclipse.swt.widgets.Shell;
/**
* Action to select file types for the search dialog.
*/
public class SystemSearchSelectFileTypesAction
extends SystemSelectFileTypesAction {
/**
* Creates the action.
* @param shell
*/
public SystemSearchSelectFileTypesAction(Shell shell) {
super(shell);
}
/**
* @see org.eclipse.rse.ui.actions.SystemBaseDialogAction#createDialog(org.eclipse.swt.widgets.Shell)
*/
public Dialog createDialog(Shell parent) {
SystemSearchSelectFileTypesDialog dialog = new SystemSearchSelectFileTypesDialog(getShell(), types);
return dialog;
}
}

View file

@ -1,132 +0,0 @@
/********************************************************************************
* Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
********************************************************************************/
package org.eclipse.rse.files.ui.search;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
import org.eclipse.rse.ui.dialogs.SystemSelectFileTypesDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IFileEditorMapping;
import org.eclipse.ui.PlatformUI;
/**
* File types selection dialog for the search page.
*/
public class SystemSearchSelectFileTypesDialog extends SystemSelectFileTypesDialog {
/**
* Creates the dialog.
* @param shell the shell.
* @param currentTypes types to preselect.
*/
public SystemSearchSelectFileTypesDialog(Shell shell, Collection currentTypes) {
super(shell, currentTypes);
}
/**
* @see org.eclipse.rse.ui.dialogs.SystemSelectFileTypesDialog#checkInitialSelections()
*/
protected void checkInitialSelections() {
IFileEditorMapping editorMappings[] = PlatformUI.getWorkbench().getEditorRegistry().getFileEditorMappings();
ArrayList selectedMappings = new ArrayList();
// go through all editor mappings, and check of those that are in the initial selections
for (int i = 0; i < editorMappings.length; i++) {
IFileEditorMapping mapping = editorMappings[i];
if (initialSelections.contains(mapping.getExtension())) {
listViewer.setChecked(mapping, true);
selectedMappings.add(mapping.getExtension());
}
}
// now find those entries in the initial selections that are not in editor mappings
// add these entries to the user defined list
Iterator initialIterator = initialSelections.iterator();
StringBuffer entries = new StringBuffer();
boolean first = true;
while(initialIterator.hasNext()) {
String nextExtension = (String)initialIterator.next();
if(!selectedMappings.contains(nextExtension)) {
if (!first) {
// if not the first entry, add a comma and a space
entries.append(TYPE_DELIMITER);
entries.append(" "); //$NON-NLS-1$
}
else {
first = false;
}
entries.append(nextExtension);
}
}
userDefinedText.setText(entries.toString());
}
/**
* @see org.eclipse.rse.ui.dialogs.SystemSelectFileTypesDialog#addUserDefinedEntries(java.util.List)
*/
protected void addUserDefinedEntries(List result) {
StringTokenizer tokenizer = new StringTokenizer(userDefinedText.getText(), TYPE_DELIMITER);
while (tokenizer.hasMoreTokens()) {
String currentExtension = tokenizer.nextToken().trim();
if (!currentExtension.equals("")) { //$NON-NLS-1$
result.add(currentExtension);
}
}
}
/**
* @see org.eclipse.rse.ui.dialogs.SystemPromptDialog#processOK()
*/
protected boolean processOK() {
IFileEditorMapping[] children = getInput();
List list = new ArrayList();
// build a list of selected children
for (int i = 0; i < children.length; ++i) {
IFileEditorMapping element = children[i];
if (listViewer.getChecked(element)) {
list.add(element.getLabel());
}
}
addUserDefinedEntries(list);
setResult(list);
return true;
}
/**
* @see org.eclipse.rse.ui.dialogs.SystemSelectFileTypesDialog#validateFileType(java.lang.String)
*/
protected boolean validateFileType(String filename) {
return true;
}
}