Package org.eclipse.debug.internal.ui.launchConfigurations

Examples of org.eclipse.debug.internal.ui.launchConfigurations.EnvironmentVariable


      return new ILabelProvider() {
        public Image getImage(Object element) {
          return DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_ENVIRONMENT);
        }
        public String getText(Object element) {
          EnvironmentVariable var = (EnvironmentVariable) element;
          return MessageFormat.format(LaunchConfigurationsMessages.EnvironmentTab_7, new String[] {var.getName(), var.getValue()});
        }
        public void addListener(ILabelProviderListener listener) {
        }
        public void dispose() {
        }
View Full Code Here


   
    String name = dialog.getStringValue(NAME_LABEL);
    String value = dialog.getStringValue(VALUE_LABEL);
   
    if (name != null && value != null && name.length() > 0 && value.length() >0) {
      addVariable(new EnvironmentVariable(name.trim(), value.trim()));
      updateAppendReplace();
    }
  }
View Full Code Here

   */
  protected boolean addVariable(EnvironmentVariable variable) {
    String name= variable.getName();
    TableItem[] items = environmentTable.getTable().getItems();
    for (int i = 0; i < items.length; i++) {
      EnvironmentVariable existingVariable = (EnvironmentVariable) items[i].getData();
      if (existingVariable.getName().equals(name)) {
        boolean overWrite= MessageDialog.openQuestion(getShell(), LaunchConfigurationsMessages.EnvironmentTab_12, MessageFormat.format(LaunchConfigurationsMessages.EnvironmentTab_13, new String[] {name})); //
        if (!overWrite) {
          return false;
        }
        environmentTable.remove(existingVariable);
View Full Code Here

    Map envVariables = getNativeEnvironment();
   
    //get Environment Variables from the table
    TableItem[] items = environmentTable.getTable().getItems();
    for (int i = 0; i < items.length; i++) {
      EnvironmentVariable var = (EnvironmentVariable) items[i].getData();
      envVariables.remove(var.getName());
    }
   
    NativeEnvironmentSelectionDialog dialog = new NativeEnvironmentSelectionDialog(getShell(), envVariables);
    dialog.setTitle(LaunchConfigurationsMessages.EnvironmentTab_20);
   
View Full Code Here

    Map stringVars = DebugPlugin.getDefault().getLaunchManager().getNativeEnvironmentCasePreserved();
    HashMap vars = new HashMap();
    for (Iterator i = stringVars.keySet().iterator(); i.hasNext(); ) {
      String key = (String) i.next();
      String value = (String) stringVars.get(key);
      vars.put(key, new EnvironmentVariable(key, value));
    }
    return vars;
  }
View Full Code Here

  /**
   * Creates an editor for the value of the selected environment variable.
   */
  private void handleEnvEditButtonSelected() {
    IStructuredSelection sel= (IStructuredSelection) environmentTable.getSelection();
    EnvironmentVariable var= (EnvironmentVariable) sel.getFirstElement();
    if (var == null) {
      return;
    }
    String originalName= var.getName();
    String value= var.getValue();
    MultipleInputDialog dialog= new MultipleInputDialog(getShell(), LaunchConfigurationsMessages.EnvironmentTab_11);
    dialog.addTextField(NAME_LABEL, originalName, false);
    dialog.addVariablesField(VALUE_LABEL, value, true);
   
    if (dialog.open() != Window.OK) {
      return;
    }
    String name= dialog.getStringValue(NAME_LABEL);
    value= dialog.getStringValue(VALUE_LABEL);
    if (!originalName.equals(name)) {
      if (addVariable(new EnvironmentVariable(name, value))) {
        environmentTable.remove(var);
      }
    } else {
      var.setValue(value);
      environmentTable.update(var, null);
      updateLaunchConfigurationDialog();
    }
  }
View Full Code Here

   */
  private void handleEnvRemoveButtonSelected() {
    IStructuredSelection sel = (IStructuredSelection) environmentTable.getSelection();
    environmentTable.getControl().setRedraw(false);
    for (Iterator i = sel.iterator(); i.hasNext(); ) {
      EnvironmentVariable var = (EnvironmentVariable) i.next()
    environmentTable.remove(var);
    }
    environmentTable.getControl().setRedraw(true);
    updateAppendReplace();
    updateLaunchConfigurationDialog();
View Full Code Here

    // configuration's attributes.
    TableItem[] items = environmentTable.getTable().getItems();
    Map map = new HashMap(items.length);
    for (int i = 0; i < items.length; i++)
    {
      EnvironmentVariable var = (EnvironmentVariable) items[i].getData();
      map.put(var.getName(), var.getValue());
    }
    if (map.size() == 0) {
      configuration.setAttribute(Constants.ATTR_ENVIRONMENT_VARIABLES, (Map) null);
    } else {
      configuration.setAttribute(Constants.ATTR_ENVIRONMENT_VARIABLES, map);
View Full Code Here

      if (m != null && !m.isEmpty()) {
        elements = new EnvironmentVariable[m.size()];
        String[] varNames = new String[m.size()];
        m.keySet().toArray(varNames);
        for (int i = 0; i < m.size(); i++) {
          elements[i] = new EnvironmentVariable(varNames[i], (String) m.get(varNames[i]));
        }
      }
      return elements;
    }
View Full Code Here

   */
  public class EnvironmentVariableLabelProvider extends LabelProvider implements ITableLabelProvider {
    public String getColumnText(Object element, int columnIndex)   {
      String result = null;
      if (element != null) {
        EnvironmentVariable var = (EnvironmentVariable) element;
        switch (columnIndex) {
          case 0: // variable
            result = var.getName();
            break;
          case 1: // value
            result = var.getValue();
            break;
        }
      }
      return result;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.debug.internal.ui.launchConfigurations.EnvironmentVariable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.