Révision 334
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/preferences/ChartsEnginePreferencePage.java (revision 334) | ||
---|---|---|
100 | 100 |
this.setDescription(SWTComponentsProviderMessages.ChartsEnginePreferencePage_PreferencesWillBeAppliedToNewChart); |
101 | 101 |
} |
102 | 102 |
|
103 |
// @Override
|
|
104 |
// public boolean performOk() {
|
|
105 |
// |
|
106 |
// super.performOk();
|
|
107 |
// |
|
108 |
// // Do nothing if the property has not been changed
|
|
109 |
// if(this.hasChanged) {
|
|
110 |
// |
|
111 |
// Log.info(SWTComponentsProviderMessages.ChartsEnginePreferencePage_LOG_RECREATING_CHARTS_ENGINE);
|
|
112 |
// |
|
113 |
// ChartsEngine.setCurrrentChartsEngine(this.getPreferenceStore().getString(ChartsEnginePreferences.CURRENT_NAME));
|
|
114 |
// |
|
115 |
// // Sets the new current charts SWT component provider according to the new current charts engine
|
|
116 |
// SWTChartsComponentsProvider.setCurrrentComponentsProvider(ChartsEngine.getCurrent());
|
|
117 |
// |
|
118 |
// // Set the first charts engine supported export file format as default charts export file format
|
|
119 |
// TXMPreferences.putString(ChartsEnginePreferences.PREFERENCES_NODE, ChartsEnginePreferences.RDEVICE, ChartsEngine.getCurrent().getSupportedOutputFileFormats().get(0));
|
|
120 |
// |
|
121 |
// |
|
122 |
// // Set the new monochrome color for all charts engine theme
|
|
123 |
// for(int i = 0; i < ChartsEngine.getChartsEngines().size(); i++) {
|
|
124 |
// ChartsEngine.getChartsEngines().get(i).getTheme().setMonochromeColor(TXMPreferences.getString(ChartsEnginePreferences.PREFERENCES_NODE, ChartsEnginePreferences.MONOCHROME_COLOR));
|
|
125 |
// }
|
|
126 |
// |
|
127 |
// |
|
128 |
// // Refresh the User\Export preference page to update "Default charts export file format" combo box
|
|
129 |
// PlatformUI.getWorkbench().getPreferenceManager().
|
|
130 |
// find("org.txm.rcp.preferences.TextometriePreferencePage/" + UserPreferencePage.ID + "/" + ExportPreferencePage.ID).createPage(); //$NON-NLS-1$ //$NON-NLS-2$
|
|
131 |
// }
|
|
132 |
// |
|
133 |
//// // FIXME: useless ?
|
|
134 |
//// Explorer.refresh();
|
|
135 |
// |
|
136 |
// return true;
|
|
137 |
// }
|
|
103 |
@Override |
|
104 |
public boolean performOk() { |
|
105 |
|
|
106 |
super.performOk(); |
|
107 |
|
|
108 |
// Do nothing if the property has not been changed |
|
109 |
if(this.hasChanged) { |
|
110 |
|
|
111 |
Log.info(SWTComponentsProviderMessages.ChartsEnginePreferencePage_LOG_RECREATING_CHARTS_ENGINE); |
|
112 |
|
|
113 |
ChartsEngine.setCurrrentChartsEngine(this.getPreferenceStore().getString(ChartsEnginePreferences.CURRENT_NAME)); |
|
114 |
|
|
115 |
// Sets the new current charts SWT component provider according to the new current charts engine |
|
116 |
SWTChartsComponentsProvider.setCurrrentComponentsProvider(ChartsEngine.getCurrent()); |
|
117 |
|
|
118 |
// Set the first charts engine supported export file format as default charts export file format |
|
119 |
TXMPreferences.putString(ChartsEnginePreferences.PREFERENCES_NODE, ChartsEnginePreferences.RDEVICE, ChartsEngine.getCurrent().getSupportedOutputFileFormats().get(0)); |
|
120 |
|
|
121 |
|
|
122 |
// Set the new monochrome color for all charts engine theme |
|
123 |
for(int i = 0; i < ChartsEngine.getChartsEngines().size(); i++) { |
|
124 |
ChartsEngine.getChartsEngines().get(i).getTheme().setMonochromeColor(TXMPreferences.getString(ChartsEnginePreferences.PREFERENCES_NODE, ChartsEnginePreferences.MONOCHROME_COLOR)); |
|
125 |
} |
|
126 |
|
|
127 |
|
|
128 |
// Refresh the User\Export preference page to update "Default charts export file format" combo box |
|
129 |
PlatformUI.getWorkbench().getPreferenceManager(). |
|
130 |
find("org.txm.rcp.preferences.TextometriePreferencePage/" + UserPreferencePage.ID + "/" + ExportPreferencePage.ID).createPage(); //$NON-NLS-1$ //$NON-NLS-2$ |
|
131 |
} |
|
132 |
|
|
133 |
// // FIXME: useless ? |
|
134 |
// Explorer.refresh(); |
|
135 |
|
|
136 |
return true; |
|
137 |
} |
|
138 | 138 |
} |
Formats disponibles : Unified diff