Examples of EnvironmentVariable


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

    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

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

  /**
   * 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

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

   */
  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

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

    // 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

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

      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

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

   */
  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

Examples of org.joget.apps.app.model.EnvironmentVariable

    @Override
    public boolean delete(String id, AppDefinition appDef) {
        boolean result = false;
        try {
            EnvironmentVariable obj = loadById(id, appDef);

            // detach from app
            if (obj != null) {
                Collection<EnvironmentVariable> list = appDef.getEnvironmentVariableList();
                for (EnvironmentVariable object : list) {
                    if (obj.getId().equals(object.getId())) {
                        list.remove(obj);
                        break;
                    }
                }
                obj.setAppDefinition(null);

                // delete obj
                super.delete(getEntityName(), obj);
                result = true;
            }
View Full Code Here

Examples of org.joget.apps.app.model.EnvironmentVariable

                if (!(value != null && value.trim().length() > 0)) {
                    String envVariable = getPropertyString("envVariable");
                    AppDefinition appDef = AppUtil.getCurrentAppDefinition();
                    ApplicationContext appContext = AppUtil.getApplicationContext();
                    EnvironmentVariableDao environmentVariableDao = (EnvironmentVariableDao) appContext.getBean("environmentVariableDao");
                    EnvironmentVariable env = environmentVariableDao.loadById(envVariable, appDef);

                    int count = 0;

                    if (env != null && env.getValue() != null && env.getValue().trim().length() > 0) {
                        count = Integer.parseInt(env.getValue());
                    }
                    count += 1;

                    String format = getPropertyString("format");
                    value = format;
                    Matcher m = Pattern.compile("(\\?+)").matcher(format);
                    if (m.find()) {
                        String pattern = m.group(1);
                        String formater = pattern.replaceAll("\\?", "0");
                        pattern = pattern.replaceAll("\\?", "\\\\?");

                        DecimalFormat myFormatter = new DecimalFormat(formater);
                        String runningNumber = myFormatter.format(count);
                        value = value.replaceAll(pattern, runningNumber);
                    }

                    if (env == null) {
                        env = new EnvironmentVariable();
                        env.setAppDefinition(appDef);
                        env.setAppId(appDef.getId());
                        env.setAppVersion(appDef.getVersion());
                        env.setId(envVariable);
                        env.setRemarks("Used for plugin: " + getName());
                        env.setValue(Integer.toString(count));
                        environmentVariableDao.add(env);
                    } else {
                        env.setValue(Integer.toString(count));
                        environmentVariableDao.update(env);
                    }

                }
            } catch (Exception e) {
View Full Code Here

Examples of org.joget.apps.app.model.EnvironmentVariable

    public String processHashVariable(String variableKey) {
        AppDefinition appDef = (AppDefinition) getProperty("appDefinition");
        if (appDef != null) {
            ApplicationContext appContext = AppUtil.getApplicationContext();
            EnvironmentVariableDao environmentVariableDao = (EnvironmentVariableDao) appContext.getBean("environmentVariableDao");
            EnvironmentVariable env = environmentVariableDao.loadById(variableKey, appDef);
            if (env != null) {
                return env.getValue();
            }
        }
        return null;
    }
View Full Code Here

Examples of org.joget.apps.app.model.EnvironmentVariable

        }

        if (appDef.getEnvironmentVariableList() != null) {
            for (EnvironmentVariable o : appDef.getEnvironmentVariableList()) {
                if (!overrideEnvVariable && orgAppDef != null && orgAppDef.getEnvironmentVariableList() != null) {
                    EnvironmentVariable temp = environmentVariableDao.loadById(o.getId(), orgAppDef);
                    if (temp != null) {
                        o.setValue(temp.getValue());
                    }
                }
               
                if (o.getValue() == null) {
                    o.setValue("");
                }
                o.setAppDefinition(newAppDef);
               
                environmentVariableDao.add(o);
            }
        }
       
        if (appDef.getMessageList() != null) {
            for (Message o : appDef.getMessageList()) {
                o.setAppDefinition(newAppDef);
                messageDao.add(o);
            }
        }

        if (appDef.getPluginDefaultPropertiesList() != null) {
            for (PluginDefaultProperties o : appDef.getPluginDefaultPropertiesList()) {
                if (!overridePluginDefault && orgAppDef != null && orgAppDef.getPluginDefaultPropertiesList() != null) {
                    PluginDefaultProperties temp = pluginDefaultPropertiesDao.loadById(o.getId(), orgAppDef);
                    if (temp != null) {
                        o.setPluginProperties(temp.getPluginProperties());
                    }
                }
               
                o.setAppDefinition(newAppDef);
                pluginDefaultPropertiesDao.add(o);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.