File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed
src/de/anbos/eclipse/easyshell/plugin/misc Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ Require-Bundle: org.eclipse.ui,
1515 org.eclipse.cdt.ui;resolution:=optional,
1616 org.eclipse.cdt.core;resolution:=optional,
1717 org.eclipse.ui.workbench.texteditor,
18- org.eclipse.jface.text
18+ org.eclipse.jface.text,
19+ org.eclipse.debug.ui
1920Bundle-RequiredExecutionEnvironment : JavaSE-11
2021Bundle-ActivationPolicy : lazy
2122Bundle-ClassPath : target/easyshell-library.jar
Original file line number Diff line number Diff line change 235235 name =" EasyShell All (Multiple Action)" >
236236 </editor >
237237 </extension >
238+ <extension
239+ point =" org.eclipse.debug.ui.stringVariablePresentations" >
240+ <variablePresentation
241+ argumentSelector =" de.anbos.eclipse.easyshell.plugin.misc.DynamicVariableSelector"
242+ variableName =" easyshell" >
243+ </variablePresentation >
244+ </extension >
238245
239246</plugin >
Original file line number Diff line number Diff line change 1+ package de .anbos .eclipse .easyshell .plugin .misc ;
2+
3+ import org .eclipse .core .variables .IStringVariable ;
4+ import org .eclipse .debug .ui .stringsubstitution .IArgumentSelector ;
5+ import org .eclipse .jface .viewers .LabelProvider ;
6+ import org .eclipse .jface .window .Window ;
7+ import org .eclipse .swt .widgets .Shell ;
8+ import org .eclipse .ui .dialogs .ElementListSelectionDialog ;
9+
10+ import de .anbos .eclipse .easyshell .plugin .types .Variable ;
11+
12+ public class DynamicVariableSelector implements IArgumentSelector {
13+
14+ @ Override
15+ public String selectArgument (IStringVariable stringVariable , Shell shell ) {
16+ ElementListSelectionDialog dialog = new ElementListSelectionDialog (shell , new LabelProvider ());
17+ var varNames = Variable .getVisibleVariables ().stream ().map (variable -> variable .getName ()).sorted ()
18+ .toArray (String []::new );
19+ dialog .setElements (varNames );
20+ dialog .setTitle ("Select EasyShell Variable" );
21+ dialog .setMessage ("Select an EasyShell variable (? = any character, * = any String):" );
22+ if (dialog .open () == Window .OK ) {
23+ return (String ) dialog .getResult ()[0 ];
24+ }
25+ return null ;
26+ }
27+
28+ }
You can’t perform that action at this time.
0 commit comments