コード例 #1
0
 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;
 }
コード例 #2
0
  /**
   * @param templatePreferencePart
   * @param enable
   */
  private void enableFields(
      final TemplatePreferencePart templatePreferencePart, final boolean enable) {
    final GlobalSettings globalSettings = GlobalSettings.getInstance();

    if (isDetailedTemplate()) {
      templatePreferencePart.templateAllowedFileNamesField.setEnabled(
          enable, getFieldEditorParent());
      templatePreferencePart.firstTemplateRadioButton.setEnabled(enable, getFieldEditorParent());
      this.prefValueOf1stTemplateItem =
          getPreferenceStore()
              .getString(
                  getTemplatePreferenceKey(
                      templatePreferencePart.templateName, P_TEMPLATE_FIRST_TEMPLATE_ITEM));
      enableTemplateItems(templatePreferencePart, this.prefValueOf1stTemplateItem);
      if (!enable) {
        templatePreferencePart.secondTemplateRadioButton.setEnabled(enable, getFieldEditorParent());
        templatePreferencePart.getterSetterRadioButton.setEnabled(enable, getFieldEditorParent());
        templatePreferencePart.numberOfRequiredClassesField.setEnabled(
            enable, getFieldEditorParent());
      }
      templatePreferencePart.allowMultipleVariationCheckBox.setEnabled(
          enable, getFieldEditorParent());
    }
    templatePreferencePart.templateVariationField.setEnabled(enable, getFieldEditorParent());
    templatePreferencePart.templateDescriptionField.setEnabled(enable, getFieldEditorParent());
    if (FALSE_STR.equalsIgnoreCase(
        globalSettings.getPropertyValue(DEFAULT_TEMPLATE_VARIATION_FIELD, TRUE_STR))) {
      templatePreferencePart.templateVariationFieldNameField.setEnabled(
          enable, getFieldEditorParent());
    }
    if (isShowAllowedFileExtension()) {
      templatePreferencePart.templateAllowedFileNamesField.setEnabled(
          enable, getFieldEditorParent());
    }
    templatePreferencePart.additionalParametersField.setEnabled(enable, getFieldEditorParent());
    templatePreferencePart.templateBodyField.setEnabled(enable, getFieldEditorParent());
    // templatePreferencePart.templateFileField.setEnabled(enable,
    // getFieldEditorParent());
  }
コード例 #3
0
 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;
 }
コード例 #4
0
  @Override
  public void createFieldEditors() {
    // IApplicationContext ctx = FastCodeContext
    // IRulesStrategy[] editRuleStrategies =
    // ctx.getTemplateRuleStrategies();
    int i = 0;
    for (final String template : this.TEMPLATES_LIST) {
      // System.out.println("template = " + template);
      if (isEmpty(template)) {

        continue;
      }
      final GlobalSettings globalSettings = GlobalSettings.getInstance();
      final TemplatePreferencePart templatePreferencePart =
          this.templatePreferenceParts[i++] = new TemplatePreferencePart(template);
      addField(
          templatePreferencePart.createEnableTemplateCheckBox(
              getFieldEditorParent(), this.commonTemplate, this.templatePrefix));
      addField(templatePreferencePart.createTemplateDescriptionField(getFieldEditorParent()));
      addField(templatePreferencePart.createTemplateVariationField(getFieldEditorParent()));
      if (FALSE_STR.equalsIgnoreCase(
          globalSettings.getPropertyValue(DEFAULT_TEMPLATE_VARIATION_FIELD, TRUE_STR))) {
        addField(
            templatePreferencePart.createTemplateVariationFieldNameField(getFieldEditorParent()));
      }

      if (isShowAllowedFileExtension()) {
        addField(
            templatePreferencePart.createTemplateAllowedFileExtensionsField(
                getFieldEditorParent()));
      }
      if (isDetailedTemplate()) {
        // addField(templatePreferencePart.createClassNameField(getFieldEditorParent()));
        addField(
            templatePreferencePart.createAllowMultipleVariationCheckBox(getFieldEditorParent()));
        // templatePreferencePart.templateAllowedFileExtensionsField.setEmptyStringAllowed(false);
        addField(templatePreferencePart.createFirstTemplateRadioButton(getFieldEditorParent()));
        this.prefValueOf1stTemplateItem =
            getPreferenceStore()
                .getString(getTemplatePreferenceKey(template, P_TEMPLATE_FIRST_TEMPLATE_ITEM));
        this.prefValueOf2ndTempalteItem =
            getPreferenceStore()
                .getString(getTemplatePreferenceKey(template, P_TEMPLATE_SECOND_TEMPLATE_ITEM));
        addField(templatePreferencePart.createNumberOfRequiredClassesField(getFieldEditorParent()));
        addField(templatePreferencePart.createSecondTemplateRadioButton(getFieldEditorParent()));
        addField(templatePreferencePart.createGetterSetterRadioButton(getFieldEditorParent()));
      }

      addField(
          templatePreferencePart.createAdditionalParametersField(
              getFieldEditorParent(), this.templatePrefix));
      addField(
          templatePreferencePart.createTemplateBodyField(
              getFieldEditorParent(), this.templatePrefix));
      templatePreferencePart.templateBodyField.setEmptyStringAllowed(false);
      if (isDetailedTemplate()) {

        templatePreferencePart.templateBodyField.setEmptyStringAllowed(false);
      }
      // addField(templatePreferencePart.createTemplateFileField(getFieldEditorParent()));
      final boolean enabled =
          getPreferenceStore()
              .getBoolean(getTemplatePreferenceKey(template, P_TEMPLATE_ENABLE_TEMPLATE));

      enableFields(templatePreferencePart, enabled);
      new Separator(SWT.SEPARATOR | SWT.HORIZONTAL)
          .doFillIntoGrid(getFieldEditorParent(), 10, convertHeightInCharsToPixels(2));
    }
    createImportExportButtons(getFieldEditorParent());
  }
コード例 #5
0
  /** @param event */
  @Override
  public void propertyChange(final PropertyChangeEvent event) {
    super.propertyChange(event);
    final Object source = event.getSource();
    final Object newValue = event.getNewValue();
    this.classSelected = false;
    this.fileSelected = false;
    this.pkgSelected = false;
    this.fldrSelected = false;
    this.enumSelected = false;
    final GlobalSettings globalSettings = GlobalSettings.getInstance();

    for (int i = 0; i < this.TEMPLATES_LIST.length; i++) {
      this.prefValueOf1stTemplateItem =
          getPreferenceStore()
              .getString(
                  getTemplatePreferenceKey(
                      this.templatePreferenceParts[i].templateName,
                      P_TEMPLATE_FIRST_TEMPLATE_ITEM));
      this.prefValueOf2ndTempalteItem =
          getPreferenceStore()
              .getString(
                  getTemplatePreferenceKey(
                      this.templatePreferenceParts[i].templateName,
                      P_TEMPLATE_SECOND_TEMPLATE_ITEM));
      if (source == this.templatePreferenceParts[i].enableTemplateCheckBox) {
        final boolean enbale = (Boolean) newValue;
        enableFields(this.templatePreferenceParts[i], enbale);
        break;
      } else if (source == this.templatePreferenceParts[i].allowMultipleVariationCheckBox) {
        this.templatePreferenceParts[i].templateVariationField.setEmptyStringAllowed(
            !(Boolean) newValue);
        if (FALSE_STR.equalsIgnoreCase(
            globalSettings.getPropertyValue(DEFAULT_TEMPLATE_VARIATION_FIELD, TRUE_STR))) {
          this.templatePreferenceParts[i].templateVariationFieldNameField.setEmptyStringAllowed(
              !(Boolean) newValue);
        }
        break;
      } else if (source == this.templatePreferenceParts[i].templateVariationField) {
        if (FALSE_STR.equalsIgnoreCase(
            globalSettings.getPropertyValue(DEFAULT_TEMPLATE_VARIATION_FIELD, TRUE_STR))) {
          this.templatePreferenceParts[i].templateVariationFieldNameField.setEmptyStringAllowed(
              isEmpty((String) newValue));
        }
        break;
      } else if (source == this.templatePreferenceParts[i].templateVariationFieldNameField) {
        final boolean isErr =
            ((String) newValue).endsWith(" ") || ((String) newValue).endsWith("\t");
        setErrorMessage(isErr ? "Variation Field cannot end with whitespace" : null);
        this.templatePreferenceParts[i].templateVariationField.setEmptyStringAllowed(
            isEmpty((String) newValue));
        break;
      } else if (source == this.templatePreferenceParts[i].firstTemplateRadioButton) {
        setErrorMessage(null);
        this.currentValueOf1stTemplateItem = (String) newValue;
        enableTemplateItems(this.templatePreferenceParts[i], newValue);

        validateSecondTemplateItem(this.currentValueOf2ndTemplateItem);
        break;
      } else if (source == this.templatePreferenceParts[i].secondTemplateRadioButton) {
        this.currentValueOf2ndTemplateItem = (String) newValue;

        if (newValue.equals(SECOND_TEMPLATE.field.getValue())
            || newValue.equals(SECOND_TEMPLATE.both.getValue())
            || newValue.equals(SECOND_TEMPLATE.custom.getValue())) {
          this.templatePreferenceParts[i].getterSetterRadioButton.setEnabled(
              true, getFieldEditorParent());
        } else if (newValue.equals(SECOND_TEMPLATE.method.getValue())
            || newValue.equals(SECOND_TEMPLATE.none.getValue())) {
          getPreferenceStore()
              .setValue(
                  getTemplatePreferenceKey(
                      this.templatePreferenceParts[i].templateName, P_TEMPLATE_GETTER_SETTER),
                  GETTER_SETTER.NONE.getValue());
          this.templatePreferenceParts[i].getterSetterRadioButton.setEnabled(
              false, getFieldEditorParent());
        }
        if (isEmpty(this.currentValueOf1stTemplateItem)) {
          this.currentValueOf1stTemplateItem = this.prefValueOf1stTemplateItem;
        }
        this.classSelected =
            this.currentValueOf1stTemplateItem.equals(FIRST_TEMPLATE.Class.getValue());
        this.fileSelected =
            this.currentValueOf1stTemplateItem.equals(FIRST_TEMPLATE.File.getValue());
        this.pkgSelected =
            this.currentValueOf1stTemplateItem.equals(FIRST_TEMPLATE.Package.getValue());
        this.fldrSelected =
            this.currentValueOf1stTemplateItem.equals(FIRST_TEMPLATE.Folder.getValue());
        this.enumSelected =
            this.currentValueOf1stTemplateItem.equals(FIRST_TEMPLATE.Enumeration.getValue());
        validateSecondTemplateItem(newValue);
        break;
      } else if (source == this.templatePreferenceParts[i].additionalParametersField) {
        if (!isEmpty(newValue.toString())) {
          try {
            parseAdditonalParam(newValue.toString());
          } catch (final FastCodeException ex) {
            // throw new Exception(ex);
          }
          /*final String addtnlParams[] = newValue.toString().split("\\s+");
          final Map<String, String> addtnParamMap = new HashMap<String, String>();
          for (final String params : addtnlParams) {
          	if (params.contains(COLON)) {
          		final String parseParam[] = params.split(COLON);
          		if (parseParam.length == 2) {
          			final String type = parseParam[1].trim().toLowerCase();
          			if (isEmpty(type)
          					|| !(type.equalsIgnoreCase(FIRST_TEMPLATE.Class.getValue())
          							|| type.equalsIgnoreCase(FIRST_TEMPLATE.File.getValue())
          							|| type.equalsIgnoreCase(FIRST_TEMPLATE.Package.getValue())
          							|| type.equalsIgnoreCase(FIRST_TEMPLATE.Folder.getValue())
          							|| type.equalsIgnoreCase(RETURN_TYPES.JAVAPROJECT.getValue())
          							|| type.equalsIgnoreCase(RETURN_TYPES.PROJECT.getValue())
          							|| type.equalsIgnoreCase(RETURN_TYPES.LOCALVAR.getValue()) || type
          								.equalsIgnoreCase(RETURN_TYPES.BOOLEAN.getValue()))) {
          				setErrorMessage("Additional Parameter type can be only class/file/package/folder/project/javaProject/localvar/boolean.");
          			} else {
          				setErrorMessage(null);
          			}
          			if (addtnParamMap.containsKey(parseParam[0])) {
          				setErrorMessage("Duplicate place holder name " + parseParam[0]);
          			}
          			addtnParamMap.put(parseParam[0], type);
          		} else if (parseParam.length == 1) {
          			setErrorMessage("Additional Parameter must have type class/file/package/folder/project/javaProject/localvar/boolean.");
          		}
          	}
          }*/
        }
      }
    }
  }
コード例 #6
0
  @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));
  }