public void apply() {
    PrintSettings printSettings = PrintSettings.getInstance();

    if (myRbCurrentFile.isSelected()){
      printSettings.setPrintScope(PrintSettings.PRINT_FILE);
    }
    else if (myRbSelectedText.isSelected()){
      printSettings.setPrintScope(PrintSettings.PRINT_SELECTED_TEXT);
    }
    else if (myRbCurrentPackage.isSelected()){
      printSettings.setPrintScope(PrintSettings.PRINT_DIRECTORY);
    }
    printSettings.setIncludeSubdirectories(myCbIncludeSubpackages.isSelected());

    printSettings.PAPER_SIZE = PageSizes.getName(myPaperSizeCombo.getSelectedItem());
    printSettings.COLOR_PRINTING = myCbColorPrinting.isSelected();
    printSettings.SYNTAX_PRINTING = myCbSyntaxPrinting.isSelected();
    printSettings.PRINT_AS_GRAPHICS = myCbPrintAsGraphics.isSelected();

    printSettings.PORTRAIT_LAYOUT = myRbPortrait.isSelected();

    printSettings.FONT_NAME = myFontNameCombo.getFontName();
    printSettings.FONT_SIZE = ObjectUtils.notNull((Integer)myFontSizeCombo.getSelectedItem(), printSettings.FONT_SIZE);

    printSettings.PRINT_LINE_NUMBERS = myCbLineNumbers.isSelected();

    printSettings.WRAP = myRbWrapAtWordBreaks.isSelected();


    try {
      printSettings.TOP_MARGIN = Float.parseFloat(myTopMarginField.getText());
    }
    catch(NumberFormatException ignored) { }

    try {
      printSettings.BOTTOM_MARGIN = Float.parseFloat(myBottomMarginField.getText());
    }
    catch(NumberFormatException ignored) { }

    try {
      printSettings.LEFT_MARGIN = Float.parseFloat(myLeftMarginField.getText());
    }
    catch(NumberFormatException ignored) { }

    try {
      printSettings.RIGHT_MARGIN = Float.parseFloat(myRightMarginField.getText());
    }
    catch(NumberFormatException ignored) { }

    printSettings.DRAW_BORDER = myCbDrawBorder.isSelected();
    printSettings.EVEN_NUMBER_OF_PAGES = myCbEvenNumberOfPages.isSelected();

    printSettings.FOOTER_HEADER_TEXT1 = myLineTextField1.getText();
    printSettings.FOOTER_HEADER_ALIGNMENT1 = (PrintSettings.Alignment)myLineAlignmentCombo1.getSelectedItem();
    printSettings.FOOTER_HEADER_PLACEMENT1 = (PrintSettings.Placement)myLinePlacementCombo1.getSelectedItem();

    printSettings.FOOTER_HEADER_TEXT2 = myLineTextField2.getText();
    printSettings.FOOTER_HEADER_ALIGNMENT2 = (PrintSettings.Alignment)myLineAlignmentCombo2.getSelectedItem();
    printSettings.FOOTER_HEADER_PLACEMENT2 = (PrintSettings.Placement)myLinePlacementCombo2.getSelectedItem();

    printSettings.FOOTER_HEADER_FONT_NAME = myFooterFontNameCombo.getFontName();
    printSettings.FOOTER_HEADER_FONT_SIZE =
      ObjectUtils.notNull((Integer)myFooterFontSizeCombo.getSelectedItem(), printSettings.FOOTER_HEADER_FONT_SIZE);
  }
public void apply()