// Trim trailing spaces if the option is turned on
if (getPreferenceStore().getBoolean(EditorPreferenceConstants.P_RTRIM_ON_SAVE)) {
// Perform Trim Trailing Spaces
RTrimAction trimAction = new RTrimAction();
try {
trimAction.setActiveEditor(null, getSite().getPage().getActiveEditor());
trimAction.run(null);
} catch (Exception e) {
e.printStackTrace();
}
}