}
});
}
private void displayOnStatusBar( double distance ) {
final IStatusLineManager statusBar = getContext().getActionBars().getStatusLineManager();
if (statusBar == null)
return; // shouldn't happen if the tool is being used.
String units = UiPlugin.getDefault().getPreferenceStore().getString(org.locationtech.udig.ui.preferences.PreferenceConstants.P_DEFAULT_UNITS);
if (units.equals( org.locationtech.udig.ui.preferences.PreferenceConstants.AUTO_UNITS) && CRSUtil.isCoordinateReferenceSystemImperial(context.getCRS())){
units = org.locationtech.udig.ui.preferences.PreferenceConstants.IMPERIAL_UNITS;
}
final String message;
if (units.equals( org.locationtech.udig.ui.preferences.PreferenceConstants.IMPERIAL_UNITS)){
message = createMessageImperial(distance);
}else{
message = createMessageMetric(distance);
}
getContext().updateUI(new Runnable(){
public void run() {
statusBar.setErrorMessage(null);
statusBar.setMessage(message);
}
});
}