1 package net.sourceforge.phpeclipse.wiki.actions.httpquery;
3 import java.util.ArrayList;
4 import java.util.Collections;
7 import net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin;
8 import net.sourceforge.phpeclipse.wiki.internal.ConfigurationManager;
9 import net.sourceforge.phpeclipse.wiki.internal.IConfiguration;
11 import org.eclipse.jface.viewers.LabelProvider;
12 import org.eclipse.jface.window.Window;
13 import org.eclipse.ui.dialogs.ListSelectionDialog;
14 import org.eclipse.ui.internal.dialogs.ListContentProvider;
16 public class HTTPQueryAction extends AbstractHTTPQueryAction {
18 public HTTPQueryAction() {
22 protected IConfiguration getUrl() {
23 String selectedURL = null;
25 List allConfigsList = ConfigurationManager.getInstance().getConfigurations();
26 ArrayList configsList = new ArrayList();
27 for (int i = 0; i < allConfigsList.size(); i++) {
28 IConfiguration temp = (IConfiguration) allConfigsList.get(i);
29 if (temp.getType().equals(WikiEditorPlugin.HTTP_QUERY)) {
30 configsList.add(temp);
33 Collections.sort(configsList);
35 ListSelectionDialog listSelectionDialog = new ListSelectionDialog(WikiEditorPlugin.getDefault().getWorkbench()
36 .getActiveWorkbenchWindow().getShell(), configsList, new ListContentProvider(), new LabelProvider(), "Select URL");
37 listSelectionDialog.setTitle("Multiple configuration found");
38 if (listSelectionDialog.open() == Window.OK) {
39 Object[] configurations = listSelectionDialog.getResult();
40 if (configurations != null) {
41 for (int i = 0; i < configurations.length; i++) {
42 return ((IConfiguration) configurations[i]); // .getURL();