TableItem configPath = getTableItemForName(COUGAAR_CONFIG_PATH); if (configPath == null) { configPath = new TableItem(this.fParametersTable, SWT.NONE); } String societyPath = fSocietyXMLFileText.getText(); if (societyPath.indexOf("/") > 0) { societyPath = societyPath .substring(0, societyPath.lastIndexOf("/")); } else if (societyPath.indexOf("\\") > 0) { societyPath = societyPath.substring(0, societyPath .lastIndexOf("\\")); } String oldPath = configPath.getText(1); if (prevSocietyPath != null && !prevSocietyPath.equals("") && !prevSocietyPath.equals(";")) { StringBuffer sb = new StringBuffer(oldPath.length()); int start = 0; int end = 0; while ((end = oldPath.indexOf(prevSocietyPath, start)) != -1) { sb.append(oldPath.substring(start, end)).append(""); start = end + prevSocietyPath.length(); } sb.append(oldPath.substring(start)); oldPath = sb.toString(); } prevSocietyPath = societyPath; if (societyPath != null && !societyPath.equals("")) { String newPath = oldPath + ";" + societyPath; if (!newPath.equals(";")) { String[] nameValuePair = new String[] { COUGAAR_CONFIG_PATH, newPath}; configPath.setText(nameValuePair); } }
TableItem configPath = getTableItemForName(COUGAAR_CONFIG_PATH); if (configPath == null) { configPath = new TableItem(this.fParametersTable, SWT.NONE);
    protected void updateCougaarConfigPath() {        TableItem configPath = getTableItemForName(COUGAAR_CONFIG_PATH);        if (configPath == null) {            configPath = new TableItem(this.fParametersTable, SWT.NONE);        }        String societyPath = fSocietyXMLFileText.getText();        if (societyPath.indexOf("/") > 0) {            societyPath = societyPath                    .substring(0, societyPath.lastIndexOf("/"));        } else if (societyPath.indexOf("\\") > 0) {            societyPath = societyPath.substring(0, societyPath                    .lastIndexOf("\\"));        }        String oldPath = configPath.getText(1);        if (prevSocietyPath != null && !prevSocietyPath.equals("")                && !prevSocietyPath.equals(";")) {            StringBuffer sb = new StringBuffer(oldPath.length());            int start = 0;            int end = 0;            while ((end = oldPath.indexOf(prevSocietyPath, start)) != -1) {                sb.append(oldPath.substring(start, end)).append("");                start = end + prevSocietyPath.length();            }            sb.append(oldPath.substring(start));            oldPath = sb.toString();        }        prevSocietyPath = societyPath;        if (societyPath != null && !societyPath.equals("")) {            String newPath = oldPath + ";" + societyPath;            if (!newPath.equals(";")) {                String[] nameValuePair = new String[] { COUGAAR_CONFIG_PATH,                        newPath};                configPath.setText(nameValuePair);            }        }    }