| 19 | | protected void setCurrentValueToControls() { |
| 20 | | IPreferenceStore ps = SabotterPlugin.getDefault().getPreferenceStore(); |
| 21 | | txtUsername.setText(ps.getString(PreferenceKeys.USERID)); |
| 22 | | txtPassword.setText(ps.getString(PreferenceKeys.PASSWORD)); |
| 23 | | |
| 24 | | spnAPILimitRate.setSelection(ps.getInt(PreferenceKeys.API_LIMIT_RATE)); |
| 25 | | spnAPILimitRate.addSelectionListener(intervalListener); |
| 26 | | spnTimeLineInterval.setSelection(ps.getInt(PreferenceKeys.INTERVAL_FRIEND_TIMELINE)); |
| 27 | | spnTimeLineInterval.addSelectionListener(intervalListener); |
| 28 | | spnRepliesInterval.setSelection(ps.getInt(PreferenceKeys.INTERVAL_REPLIES)); |
| 29 | | spnRepliesInterval.addSelectionListener(intervalListener); |
| 30 | | spnDirectMessagesInterval.setSelection(ps.getInt(PreferenceKeys.INTERVAL_DIRECT_MESSAGES)); |
| 31 | | spnDirectMessagesInterval.addSelectionListener(intervalListener); |
| | 19 | public String getServiceId() { |
| | 20 | return WassrService.SERVICE_ID; |
| 35 | | protected void loadDefaultValues() { |
| 36 | | IPreferenceStore ps = SabotterPlugin.getDefault().getPreferenceStore(); |
| 37 | | ps.setValue(PreferenceKeys.USERID, SabotterPreferenceInitializer.DEF_USERNAME); |
| 38 | | ps.setValue(PreferenceKeys.PASSWORD, SabotterPreferenceInitializer.DEF_PASSWORD); |
| 39 | | ps.setValue(PreferenceKeys.API_LIMIT_RATE, 30); |
| 40 | | ps.setValue(PreferenceKeys.INTERVAL_FRIEND_TIMELINE, 5); |
| 41 | | ps.setValue(PreferenceKeys.INTERVAL_REPLIES, 12); |
| 42 | | ps.setValue(PreferenceKeys.INTERVAL_DIRECT_MESSAGES, 20); |
| 43 | | ps.setValue(PreferenceKeys.BALOON_DISPLAY_TYPE, BaloonDispayType.ALL.toString()); |
| | 27 | public void loadServiceOwnDefaultValues() { |
| | 28 | WassrPreferenceInitializer.init(SabotterPlugin.getDefault().getPreferenceStore(), getServiceId()); |
| 45 | | |
| 46 | | @Override |
| 47 | | protected void storeValues() { |
| 48 | | IPreferenceStore ps = SabotterPlugin.getDefault().getPreferenceStore(); |
| 49 | | ps.setValue(PreferenceKeys.USERID, txtUsername.getText()); |
| 50 | | ps.setValue(PreferenceKeys.PASSWORD, txtPassword.getText()); |
| 51 | | |
| 52 | | int apiLimitRate = spnAPILimitRate.getSelection(); |
| 53 | | ps.setValue(PreferenceKeys.API_LIMIT_RATE, apiLimitRate); |
| 54 | | |
| 55 | | int timeLineInterval = spnTimeLineInterval.getSelection(); |
| 56 | | ps.setValue(PreferenceKeys.INTERVAL_FRIEND_TIMELINE, timeLineInterval); |
| 57 | | |
| 58 | | int replyInterval = spnRepliesInterval.getSelection(); |
| 59 | | ps.setValue(PreferenceKeys.INTERVAL_REPLIES, replyInterval); |
| 60 | | |
| 61 | | int dmInterval = spnDirectMessagesInterval.getSelection(); |
| 62 | | ps.setValue(PreferenceKeys.INTERVAL_DIRECT_MESSAGES, dmInterval); |
| 63 | | } |
| 64 | | |