private List<RepositoryData> loadData() {
   final GlobalSettings globalSettings = GlobalSettings.getInstance();
   final String prj_url_delim =
       globalSettings.getPropertyValue(PROJECT_URL_DELIMITER.toUpperCase(), EMPTY_STR);
   final String prj_url_pair_delim =
       globalSettings.getPropertyValue(PROJECT_URL_PAIR_DELIMITER.toUpperCase(), EMPTY_STR);
   final List<RepositoryData> repDataList = new ArrayList<RepositoryData>();
   final String projectUrlPair = this.preferenceStore.getString(P_REPOSIROTY_PROJECT_URL_PAIR);
   if (!isEmpty(projectUrlPair)) {
     final String[] prjUrlArray = projectUrlPair.split(prj_url_pair_delim);
     for (final String prjURL : prjUrlArray) {
       if (!isEmpty(prjURL)) {
         final String[] prjUrlArr = prjURL.split(prj_url_delim);
         if (prjUrlArr.length < 2) {
           continue;
         }
         final RepositoryData dataFromPref = new RepositoryData();
         dataFromPref.setAssociatedProject(prjUrlArr[0].trim());
         dataFromPref.setRepUrl(prjUrlArr[1].trim());
         repDataList.add(dataFromPref);
       }
     }
   }
   return repDataList;
 }
 public static Map<String, String> getPrjUrlPairMap(final String prjUrlPairs) {
   final GlobalSettings globalSettings = GlobalSettings.getInstance();
   final String prj_url_delim =
       globalSettings.getPropertyValue(PROJECT_URL_DELIMITER.toUpperCase(), EMPTY_STR);
   final String prj_url_pair_delim =
       globalSettings.getPropertyValue(PROJECT_URL_PAIR_DELIMITER.toUpperCase(), EMPTY_STR);
   final Map<String, String> prjUrlPairMap = new HashMap<String, String>();
   if (!isEmpty(prjUrlPairs)) {
     final String[] prjUrlArray = prjUrlPairs.split(prj_url_pair_delim);
     for (final String prjURL : getEmptyArrayForNull(prjUrlArray)) {
       if (!isEmpty(prjURL)) {
         final String[] prjUrlArr = prjURL.split(prj_url_delim);
         // final String sharedPrjName =
         // prjUrlArr[1].substring(prjUrlArr[1].lastIndexOf(FORWARD_SLASH) + 1);
         if (prjUrlArr.length < 2) {
           continue;
         }
         prjUrlPairMap.put(prjUrlArr[0].trim(), prjUrlArr[1].trim());
       }
     }
   }
   return prjUrlPairMap;
 }
  @Override
  protected void createFieldEditors() {
    this.enableAutoCheckin =
        new BooleanFieldEditor(
            P_ENABLE_AUTO_CHECKIN, "Enable Auto Checkin", getFieldEditorParent());
    addField(this.enableAutoCheckin);
    this.enableResChangeListener =
        new BooleanFieldEditor(
            P_ENABLE_TRACK_ECLIPSE_CHANGE,
            "Enable Track and Check in Eclipse Changes",
            getFieldEditorParent());
    addField(this.enableResChangeListener);
    this.repositoryName =
        new ComboFieldEditor(
            P_REPOSITORY_NAME, "Repository name:  ", REPOSITORY_NAMES, getFieldEditorParent());
    addField(this.repositoryName);
    // uncomment this after enabling browse button in Repository Dialog
    /*this.repositoryBaseLocation = new StringFieldEditor(P_REPOSITORY_BASE_LOCATION, "Repository Base URL:  ", getFieldEditorParent());
    this.repositoryBaseLocation.setEmptyStringAllowed(false);
    addField(this.repositoryBaseLocation);*/

    // this.repositoryUrl = new StringFieldEditor(P_REPOSITORY_URL, "Repository Url",
    // getFieldEditorParent());
    /*this.repositoryUrl = new StringButtonFieldEditor(P_REPOSITORY_URL, "Repository Url:  ", getFieldEditorParent()) {
    	@Override
    	protected String changePressed() {
    		try {
    			final String url = VersionControlPreferencePage.this.currentValueOfRepoLoc;
    			final RepositoryService repositoryService = getRepositoryServiceClass();
    			final List<String> projects = repositoryService.getSharedProjects(url);
    			final StringSelectionDialog selectionDialog = new StringSelectionDialog(new Shell(), "Select Project", "Select Project", projects.toArray(new String[0]), false);
    			if (selectionDialog.open() == Window.CANCEL) {
    				return null;

    			} else {
    				final String repository = (String) selectionDialog.getResult()[0];
    				return url + FORWARD_SLASH + repository;
    			}
    		} catch (final FastCodeRepositoryException ex) {
    			// TODO Auto-generated catch block
    			ex.printStackTrace();
    		}
    		return null;
    	}
    };
    addField(this.repositoryUrl);*/
    this.userName =
        new StringFieldEditor(P_REPOSITORY_USERNAME, "UserName:"******"Password:"******"Project Name");
    final int minWidth = computeMinimumColumnWidth(gc, "Project Name");
    columnLayout.setColumnData(column1, new ColumnWeightData(12, minWidth, true));

    final TableViewerColumn viewerColumn2 = new TableViewerColumn(this.prjUrlViewer, SWT.NONE);
    final TableColumn column2 = viewerColumn2.getColumn();
    column2.setText("URL");
    final int minWidth1 = computeMinimumColumnWidth(gc, "URL");
    columnLayout.setColumnData(column2, new ColumnWeightData(24, minWidth1, true));

    this.prjUrlViewer.setLabelProvider(new ProjectUrlLabelProvider());
    this.prjUrlViewer.setContentProvider(new ProjectUrlContentProvider());

    this.prjUrlViewer.setInput(getEmptyListForNull(loadData()));

    final Composite buttons = new Composite(innerParent, SWT.NONE);
    buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
    final GridLayout buttonLayout = new GridLayout();
    buttonLayout.marginHeight = 0;
    buttonLayout.marginWidth = 0;
    buttons.setLayout(buttonLayout);

    this.addButton = new Button(buttons, SWT.PUSH);
    this.addButton.setText("Add");
    if (isEmpty(this.preferenceStore.getString(P_REPOSITORY_PASSWORD))
        || isEmpty(this.preferenceStore.getString(P_REPOSITORY_USERNAME))) {
      this.addButton.setEnabled(false);
    }
    this.addButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    this.addButton.addListener(
        SWT.Selection,
        new Listener() {
          @Override
          public void handleEvent(final Event e) {
            final String prjUrlPairs =
                VersionControlPreferencePage.this.preferenceStore.getString(
                    P_REPOSIROTY_PROJECT_URL_PAIR);
            final RepositoryData repositoryData = new RepositoryData();
            /*String repBaseLoc = VersionControlPreferencePage.this.currentValueOfRepoBaseLocation;
            if (isEmpty(repBaseLoc)) {
            	repBaseLoc = VersionControlPreferencePage.this.preferenceStore.getString(P_REPOSITORY_BASE_LOCATION);
            	if (isEmpty(repBaseLoc)) {
            		//openWarning(getShell(), "Please enter value for URL", "Please enter value for Repository URL");
            		//VersionControlPreferencePage.this.editButton.setEnabled(false);
            	}
            }

            repositoryData.setRepBaseLocation(repBaseLoc);*/
            // VersionControlPreferencePage.this.currentValueOfRepoName.toLowerCase() + COLON +
            // FORWARD_SLASH + FORWARD_SLASH + LOCAL_HOST); //
            repositoryData.setPrjUrlMap(getPrjUrlPairMap(prjUrlPairs));
            String userName = VersionControlPreferencePage.this.currentValueOfUserName;
            if (isEmpty(userName)) {
              userName =
                  VersionControlPreferencePage.this.preferenceStore.getString(
                      P_REPOSITORY_USERNAME);
              if (isEmpty(userName)) {
                /*openWarning(getShell(), "Please enter value for URL", "Please enter value for Repository URL");
                VersionControlPreferencePage.this.editButton.setEnabled(false);*/
              }
            }
            repositoryData.setUserName(userName);
            String password = VersionControlPreferencePage.this.currentValueOfPassWord;
            if (isEmpty(password)) {
              password =
                  VersionControlPreferencePage.this.preferenceStore.getString(
                      P_REPOSITORY_PASSWORD);
              if (isEmpty(password)) {
                /*openWarning(getShell(), "Please enter value for URL", "Please enter value for Repository URL");
                VersionControlPreferencePage.this.editButton.setEnabled(false);*/
              }
            }
            repositoryData.setPassword(password);
            repositoryData.setSource("Add");
            final RepositoryDialog repositoryDialog =
                new RepositoryDialog(getShell(), repositoryData);
            if (repositoryDialog.open() == Window.CANCEL) {
              return;
            }
            VersionControlPreferencePage.this.currentValueOfProject =
                repositoryData.getAssociatedProject();
            VersionControlPreferencePage.this.currentValueOfRepoUrl = repositoryData.getRepUrl();

            final String currPrjUrl =
                repositoryData.getAssociatedProject().trim()
                    + prj_url_delim
                    + repositoryData.getRepUrl().trim();
            VersionControlPreferencePage.this.preferenceStore.setValue(
                P_REPOSIROTY_PROJECT_URL_PAIR,
                isEmpty(prjUrlPairs) ? currPrjUrl : prjUrlPairs + prj_url_pair_delim + currPrjUrl);
            VersionControlPreferencePage.this.prjUrlViewer.setInput(
                getEmptyListForNull(loadData()));
            VersionControlPreferencePage.this.prjUrlViewer.refresh();
          }
        });

    this.editButton = new Button(buttons, SWT.PUSH);
    this.editButton.setText("Edit");
    this.editButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (isEmpty(this.preferenceStore.getString(P_REPOSITORY_PASSWORD))
        || isEmpty(this.preferenceStore.getString(P_REPOSITORY_USERNAME))) {
      this.editButton.setEnabled(false);
    }
    this.editButton.addListener(
        SWT.Selection,
        new Listener() {
          @Override
          public void handleEvent(final Event e) {

            final String prjUrlPairs =
                VersionControlPreferencePage.this.preferenceStore.getString(
                    P_REPOSIROTY_PROJECT_URL_PAIR);
            // final RepositoryData repositoryData = new RepositoryData();

            final int index = VersionControlPreferencePage.this.table.getSelectionIndex();
            if (index > -1) {
              final RepositoryData repositoryData =
                  (RepositoryData)
                      VersionControlPreferencePage.this.prjUrlViewer.getElementAt(index);
              final String origPrjUrl =
                  repositoryData.getAssociatedProject().trim()
                      + prj_url_delim
                      + repositoryData.getRepUrl().trim();
              /*String repLoc = VersionControlPreferencePage.this.currentValueOfRepoLoc;
              if (isEmpty(repLoc)) {
              	repLoc = VersionControlPreferencePage.this.preferenceStore.getString(P_REPOSITORY_LOCATION);
              	if (isEmpty(repLoc)) {
              		openWarning(getShell(), "Please enter value for URL", "Please enter value for Repository URL");
              		VersionControlPreferencePage.this.editButton.setEnabled(false);
              	}
              }*/
              repositoryData.setRepBaseLocation(
                  VersionControlPreferencePage.this
                      .currentValueOfRepoBaseLocation); // VersionControlPreferencePage.this.currentValueOfRepoName.toLowerCase() + COLON + FORWARD_SLASH + FORWARD_SLASH + LOCAL_HOST); //
              repositoryData.setPrjUrlMap(getPrjUrlPairMap(prjUrlPairs));
              String userName = VersionControlPreferencePage.this.currentValueOfUserName;
              if (isEmpty(userName)) {
                userName =
                    VersionControlPreferencePage.this.preferenceStore.getString(
                        P_REPOSITORY_USERNAME);
                if (isEmpty(userName)) {
                  /*openWarning(getShell(), "Please enter value for URL", "Please enter value for Repository URL");
                  VersionControlPreferencePage.this.editButton.setEnabled(false);*/
                }
              }
              repositoryData.setUserName(userName);
              String password = VersionControlPreferencePage.this.currentValueOfPassWord;
              if (isEmpty(password)) {
                password =
                    VersionControlPreferencePage.this.preferenceStore.getString(
                        P_REPOSITORY_PASSWORD);
                if (isEmpty(password)) {
                  /*openWarning(getShell(), "Please enter value for URL", "Please enter value for Repository URL");
                  VersionControlPreferencePage.this.editButton.setEnabled(false);*/
                }
              }
              repositoryData.setPassword(password);
              repositoryData.setSource("Edit");
              final RepositoryDialog repositoryDialog =
                  new RepositoryDialog(getShell(), repositoryData);
              if (repositoryDialog.open() == Window.CANCEL) {
                return;
              }
              VersionControlPreferencePage.this.currentValueOfProject =
                  repositoryData.getAssociatedProject();
              VersionControlPreferencePage.this.currentValueOfRepoUrl = repositoryData.getRepUrl();
              final String currPrjUrl =
                  repositoryData.getAssociatedProject().trim()
                      + prj_url_delim
                      + repositoryData.getRepUrl().trim();
              final String finalPrjUrlPairs = prjUrlPairs.replace(origPrjUrl, currPrjUrl);
              VersionControlPreferencePage.this.preferenceStore.setValue(
                  P_REPOSIROTY_PROJECT_URL_PAIR, finalPrjUrlPairs);
              VersionControlPreferencePage.this.prjUrlViewer.setInput(
                  getEmptyListForNull(loadData()));
              VersionControlPreferencePage.this.prjUrlViewer.refresh();
            }
          }
        });

    this.removeButton = new Button(buttons, SWT.PUSH);
    this.removeButton.setText("Remove");
    this.removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    this.removeButton.addListener(
        SWT.Selection,
        new Listener() {
          @Override
          public void handleEvent(final Event e) {
            final int index = VersionControlPreferencePage.this.table.getSelectionIndex();
            System.out.println("index--" + index);
            if (index > -1) {
              final RepositoryData repositoryData =
                  (RepositoryData)
                      VersionControlPreferencePage.this.prjUrlViewer.getElementAt(index);
              System.out.println("repositoryData--" + repositoryData);
              System.out.println(repositoryData.getAssociatedProject());
              System.out.println(repositoryData.getRepUrl());
              final String prjUrlPairs =
                  VersionControlPreferencePage.this.preferenceStore.getString(
                      P_REPOSIROTY_PROJECT_URL_PAIR);
              System.out.println(prjUrlPairs);
              final String finalPrjUrlPairs =
                  prjUrlPairs.replace(
                      repositoryData.getAssociatedProject().trim()
                          + prj_url_delim
                          + repositoryData.getRepUrl().trim(),
                      EMPTY_STR);
              VersionControlPreferencePage.this.preferenceStore.setValue(
                  P_REPOSIROTY_PROJECT_URL_PAIR, finalPrjUrlPairs);
              System.out.println("set to pref....");
              VersionControlPreferencePage.this.prjUrlViewer.setInput(
                  getEmptyListForNull(loadData()));
              System.out.println("refresh done...");
              VersionControlPreferencePage.this.prjUrlViewer.refresh();
              System.out.println("remove -- done");
            }
          }
        });

    this.checkIn =
        new RadioGroupFieldEditor(
            P_CHECK_IN,
            "Check In:",
            CHECK_IN_TYPES.length,
            CHECK_IN_TYPES,
            getFieldEditorParent(),
            true);
    addField(this.checkIn);
    this.timeGapBeforeAutoCheckIn =
        new IntegerFieldEditor(
            P_TIME_GAP_BEFORE_CHECK_IN,
            "Time Gap Before Check In(in Min):",
            getFieldEditorParent());
    addField(this.timeGapBeforeAutoCheckIn);
    this.excludeDir =
        new StringFieldEditor(
            P_EXCLUDE_DIR, "Directories to be excluded:  ", getFieldEditorParent());
    addField(this.excludeDir);
    this.prefixComments =
        new StringFieldEditor(P_COMMENTS_PREFIX, "Prefix Comments:  ", getFieldEditorParent());
    addField(this.prefixComments);
    this.footerComments =
        new MultiStringFieldEditor(
            P_COMMENTS_FOOTER, "Footer Comments:   ", getFieldEditorParent(), false);
    addField(this.footerComments);

    this.currentValueOfRepoName = this.preferenceStore.getString(P_REPOSITORY_NAME);
    this.currentValueOfRepoUrl = this.preferenceStore.getString(P_REPOSITORY_URL);
    this.currentValueOfUserName = this.preferenceStore.getString(P_REPOSITORY_USERNAME);
    this.currentValueOfPassWord = this.preferenceStore.getString(P_REPOSITORY_PASSWORD);
    // this.currentValueOfRepoBaseLocation =
    // this.preferenceStore.getString(P_REPOSITORY_BASE_LOCATION);

    /*if (isEmpty(this.currentValueOfRepoName) || isEmpty(this.currentValueOfRepoUrl) || isEmpty(this.currentValueOfUserName)
    		|| isEmpty(this.currentValueOfPassWord)) {
    	MessageDialog.openWarning(getShell(), "Warning", "Input value to Repository Name,Repository Url,UserName and Password fields.");
    }*/
    enableFields(getPreferenceStore().getBoolean(P_ENABLE_AUTO_CHECKIN));
  }