/** * Stores it current configuration in the dialog store. */ private void writeConfiguration() { IDialogSettings s= getDialogSettings(); s.put(STORE_CASE_SENSITIVE, fIsCaseSensitive); s.put(STORE_IS_REG_EX_SEARCH, fIsRegExSearch); s.put(STORE_SEARCH_DERIVED, fSearchDerived); int historySize= Math.min(fPreviousSearchPatterns.size(), HISTORY_SIZE); s.put(STORE_HISTORY_SIZE, historySize); for (int i= 0; i < historySize; i++) { IDialogSettings histSettings= s.addNewSection(STORE_HISTORY + i); SearchPatternData data= ((SearchPatternData) fPreviousSearchPatterns.get(i)); data.store(histSettings); } }
/** * Stores it current configuration in the dialog store. */ private void writeConfiguration() { IDialogSettings s= getDialogSettings(); s.put(STORE_CASE_SENSITIVE, fIsCaseSensitive); s.put(STORE_IS_REG_EX_SEARCH, fIsRegExSearch); s.put(STORE_IS_WHOLE_WORD, fIsWholeWord); s.put(STORE_SEARCH_DERIVED, fSearchDerived); s.put(STORE_SEARCH_IN_BINARIES, fSearchBinaries); int historySize= Math.min(fPreviousSearchPatterns.size(), HISTORY_SIZE); s.put(STORE_HISTORY_SIZE, historySize); for (int i= 0; i < historySize; i++) { IDialogSettings histSettings= s.addNewSection(STORE_HISTORY + i); SearchPatternData data= fPreviousSearchPatterns.get(i); data.store(histSettings); } IDialogSettings extensionsSettings= s.addNewSection(STORE_EXTENSIONS); extensionsSettings.put(Integer.toString(0), fExtensions.getText()); Set<String> extensions= new HashSet<>(HISTORY_SIZE); extensions.add(fExtensions.getText()); int length= Math.min(fExtensions.getItemCount(), HISTORY_SIZE - 1); int j= 1; for (int i= 0; i < length; i++) { String extension= fExtensions.getItem(i); if (extensions.add(extension)) extensionsSettings.put(Integer.toString(j++), extension); } }
IDialogSettings s= getDialogSettings(); fIsCaseSensitive= s.getBoolean(STORE_CASE_SENSITIVE); fIsRegExSearch= s.getBoolean(STORE_IS_REG_EX_SEARCH);
/** * Initializes itself from the stored page settings. */ private void readConfiguration() { IDialogSettings s= getDialogSettings(); fIsCaseSensitive= s.getBoolean(STORE_CASE_SENSITIVE); fIsRegExSearch= s.getBoolean(STORE_IS_REG_EX_SEARCH); fSearchDerived= s.getBoolean(STORE_SEARCH_DERIVED); try { int historySize= s.getInt(STORE_HISTORY_SIZE); for (int i= 0; i < historySize; i++) { IDialogSettings histSettings= s.getSection(STORE_HISTORY + i); if (histSettings != null) { SearchPatternData data= SearchPatternData.create(histSettings); if (data != null) { fPreviousSearchPatterns.add(data); } } } } catch (NumberFormatException e) { // ignore } }