1 11 package org.eclipse.debug.internal.ui.stringsubstitution; 12 13 import org.eclipse.core.variables.IStringVariable; 14 import org.eclipse.jface.viewers.LabelProvider; 15 import org.eclipse.jface.window.Window; 16 import org.eclipse.swt.widgets.Shell; 17 import org.eclipse.ui.dialogs.ElementListSelectionDialog; 18 19 24 public class SystemPropertyArgumentSelector implements IArgumentSelector { 25 26 29 public String selectArgument(IStringVariable variable, Shell shell) { 30 ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, new LabelProvider()); 31 dialog.setElements(System.getProperties().keySet().toArray()); 32 dialog.setTitle(StringSubstitutionMessages.SystemPropertyArgumentSelector_0); 33 dialog.setMessage(StringSubstitutionMessages.SystemPropertyArgumentSelector_1); 34 if (dialog.open() == Window.OK) { 35 return (String ) dialog.getResult()[0]; 36 } 37 return null; 38 } 39 40 } 41 | Popular Tags |