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 String getUrl(String selection) {
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(),
38 listSelectionDialog.setTitle("Multiple configuration found");
39 if (listSelectionDialog.open() == Window.OK) {
40 Object[] configurations = listSelectionDialog.getResult();
41 if (configurations != null) {
42 for (int i = 0; i < configurations.length; i++) {
43 selectedURL = ((IConfiguration) configurations[i]).getURL();