1 11 package org.eclipse.ant.internal.ui.launchConfigurations; 12 13 import org.eclipse.jdt.internal.debug.ui.actions.RuntimeClasspathAction; 14 import org.eclipse.jdt.internal.debug.ui.launcher.IClasspathViewer; 15 import org.eclipse.jdt.launching.IRuntimeClasspathEntry; 16 import org.eclipse.jdt.launching.JavaRuntime; 17 18 public class AddVariableStringAction extends RuntimeClasspathAction { 19 20 public AddVariableStringAction(IClasspathViewer viewer) { 21 super(AntLaunchConfigurationMessages.AddVariableStringAction_1, viewer); 22 } 23 24 27 protected int getActionType() { 28 return ADD; 29 } 30 31 34 public void run() { 35 VariableInputDialog inputDialog = new VariableInputDialog(getShell()); 36 inputDialog.open(); 37 String variableString= inputDialog.getVariableString(); 38 if (variableString != null && variableString.trim().length() > 0) { 39 IRuntimeClasspathEntry newEntry = JavaRuntime.newStringVariableClasspathEntry(variableString); 40 getViewer().addEntries(new IRuntimeClasspathEntry[] {newEntry}); 41 } 42 } 43 } 44 | Popular Tags |