/**
* OK button pressed so save changes.
*/
private void performOk()
{
CursorChanger cursorChg = new CursorChanger(_app.getMainFrame());
cursorChg.show();
try
{
final boolean isDebug = s_log.isDebugEnabled();
long start = 0;
for (Iterator<IGlobalPreferencesPanel> it = _panels.iterator(); it.hasNext();)
{
if (isDebug)
{
start = System.currentTimeMillis();
}
IGlobalPreferencesPanel pnl = it.next();
try
{
pnl.applyChanges();
}
catch (Throwable th)
{
final String msg = s_stringMgr.getString("GlobalPreferencesSheet.error.saving", pnl.getTitle());
s_log.error(msg, th);
_app.showErrorDialog(msg, th);
}
if (isDebug)
{
s_log.debug("Panel " + pnl.getTitle()
+ " applied changes in "
+ (System.currentTimeMillis() - start) + "ms");
}
}
}
finally
{
_app.savePreferences(DATATYPE_PREFERENCES);
cursorChg.restore();
}
dispose();
for (GlobalPreferencesActionListener listener : _listeners) {
listener.onPerformOk();