protected void savePreferences() { try { if (preferenceStore instanceof IPersistentPreferenceStore) { ((IPersistentPreferenceStore) preferenceStore).save(); } } catch (IOException e) { IStatus status = new Status(IStatus.ERROR, uiPlugin.getBundle().getSymbolicName(), "Unexpected internal error: ", e); //$NON-NLS-1$ uiPlugin.getLog().log(status); } }
/** * @return whether following renames is currently enabled */ protected boolean getFollowRenames() { return store.getBoolean(UIPreferences.RESOURCEHISTORY_FOLLOW_RENAMES); }
public void widgetDisposed(DisposeEvent e) { final int[] w = sf.getWeights(); store.putValue(key, UIPreferences.intArrayToString(w)); if (store.needsSaving()) try { store.save(); } catch (IOException e1) { Activator.handleError(e1.getMessage(), e1, false); } } });
public void run() { store.setValue(prefName, isChecked()); if (store.needsSaving()) try { store.save(); } catch (IOException e) { Activator.handleError(e.getMessage(), e, false); } }
BooleanPrefAction(final String pn, final String text) { setText(text); prefName = pn; historyPage.store.addPropertyChangeListener(this); setChecked(historyPage.store.getBoolean(prefName)); }
boolean keepOnWarning = prefStore.getBoolean(IDEInternalPreferences.WARN_ABOUT_WORKSPACE_INCOMPATIBILITY); if (keepOnWarning) { MessageDialogWithToggle dialog = new MessageDialogWithToggle(shell, title, null, message, severity, prefStore.setValue(IDEInternalPreferences.WARN_ABOUT_WORKSPACE_INCOMPATIBILITY, keepOnWarning); prefStore.save(); } catch (IOException e) { IDEWorkbenchPlugin.log("Error writing to configuration preferences", //$NON-NLS-1$
.getBoolean(UIPreferences.FINDTOOLBAR_IGNORE_CASE)); int selectedPrefsItem = store.getInt(UIPreferences.FINDTOOLBAR_FIND_IN);
/** * Save palette item customizations * @param paletteRoot */ public static void save(DesignerPaletteRoot paletteRoot) { IPersistentPreferenceStore prefs = getPreferenceStore(); for (Iterator it=paletteRoot.getChildren().iterator();it.hasNext();){ PaletteEntry entry = (PaletteEntry)it.next(); if (entry instanceof TaglibPaletteDrawer){ TaglibPaletteDrawer pd = (TaglibPaletteDrawer)entry; prefs.putValue(PREFS_TAGLIBHIDE_PREFIX + pd.getURI(), Boolean.toString(! pd.isVisible())); } } PaletteItemManager.notifyPaletteItemManagersOfCustomizationsUpdate(paletteRoot.getPaletteManager()); }
/** * @param compareMode * switch compare mode button of the view on / off */ public void setCompareMode(boolean compareMode) { store.setValue(UIPreferences.RESOURCEHISTORY_COMPARE_MODE, compareMode); }
public void run() { historyPage.store.setValue(prefName, isChecked()); if (historyPage.store.needsSaving()) try { historyPage.store.save(); } catch (IOException e) { Activator.handleError(e.getMessage(), e, false); } }
/** * @param store the preference store * @param pn the preference name * @param text the text for the action */ protected BooleanPrefAction(final IPersistentPreferenceStore store, final String pn, final String text) { this.store = store; setText(text); prefName = pn; store.addPropertyChangeListener(this); setChecked(store.getBoolean(prefName)); }
/** * Hide a category (TaglibPaletteDrawer) that will be persisted as a customization * @param taglibPaletteDrawer */ public static void hideTaglibDrawer(TaglibPaletteDrawer taglibPaletteDrawer){ IPersistentPreferenceStore prefs = getPreferenceStore(); taglibPaletteDrawer.setVisible(false); prefs.putValue(PREFS_TAGLIBHIDE_PREFIX + taglibPaletteDrawer.getURI(), Boolean.TRUE.toString()); save((DesignerPaletteRoot)taglibPaletteDrawer.getParent()); }
/** * Saves the templates to the preferences. * * @throws IOException if the templates cannot be written */ public void save() throws IOException { ArrayList<TemplatePersistenceData> custom= new ArrayList<>(); for (Iterator<TemplatePersistenceData> it= fTemplates.iterator(); it.hasNext();) { TemplatePersistenceData data= it.next(); if (data.isCustom() && !(data.isUserAdded() && data.isDeleted())) // don't save deleted user-added templates custom.add(data); } StringWriter output= new StringWriter(); TemplateReaderWriter writer= new TemplateReaderWriter(); writer.save(custom.toArray(new TemplatePersistenceData[custom.size()]), output); fIgnorePreferenceStoreChanges= true; try { fPreferenceStore.setValue(fKey, output.toString()); if (fPreferenceStore instanceof IPersistentPreferenceStore) ((IPersistentPreferenceStore)fPreferenceStore).save(); } finally { fIgnorePreferenceStoreChanges= false; } }
public void run() { historyPage.store.setValue( UIPreferences.RESOURCEHISTORY_SHOW_FINDTOOLBAR, isChecked()); if (historyPage.store.needsSaving()) try { historyPage.store.save(); } catch (IOException e) { Activator.handleError(e.getMessage(), e, false); } historyPage.layout(); } };
private boolean shouldRedraw(Repository db, AnyObjectId headId, List<FilterPath> paths) { boolean pathChanged = pathChanged(pathFilters, paths); boolean headChanged = headId == null || !headId.equals(currentHeadId); boolean repoChanged = false; boolean allBranchesChanged = currentShowAllBranches != store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES); currentShowAllBranches = store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES); boolean additionalRefsChange = currentShowAdditionalRefs != store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ADDITIONAL_REFS); currentShowAdditionalRefs = store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ADDITIONAL_REFS); boolean showNotesChanged = currentShowNotes != store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_NOTES); currentShowNotes = store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_NOTES); boolean followRenamesChanged = currentFollowRenames != getFollowRenames(); currentFollowRenames = getFollowRenames(); if (!db.equals(currentRepo)) { repoChanged = true; currentRepo = db; } return pathChanged || headChanged || repoChanged || allBranchesChanged || additionalRefsChange || showNotesChanged || followRenamesChanged; }
protected void toggle() { boolean newState = !isPropertySet(); IPreferenceStore store = preferenceStoreAccess.getWritablePreferenceStore(); store.setValue(getPreferenceKey(), newState); if (store instanceof IPersistentPreferenceStore) try { ((IPersistentPreferenceStore) store).save(); } catch (IOException e) { // log and ignore logger.debug(e.getMessage(), e); } stateChanged(newState); }
public void widgetSelected(SelectionEvent e) { store.setValue(UIPreferences.FINDTOOLBAR_IGNORE_CASE, caseItem.getSelection()); if (store.needsSaving()){ try { store.save(); } catch (IOException e1) { Activator.handleError(e1.getMessage(), e1, false); } } clear(); } });
private void createFindToolbarAction() { findAction = new Action(UIText.GitHistoryPage_FindMenuLabel, UIIcons.ELCL16_FIND) { public void run() { historyPage.store.setValue( UIPreferences.RESOURCEHISTORY_SHOW_FINDTOOLBAR, isChecked()); if (historyPage.store.needsSaving()) try { historyPage.store.save(); } catch (IOException e) { Activator.handleError(e.getMessage(), e, false); } historyPage.layout(); } }; findAction .setChecked(historyPage.store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_FINDTOOLBAR)); findAction.setToolTipText(UIText.GitHistoryPage_FindTooltip); }
public void save() { if (store.needsSaving() && store instanceof IPersistentPreferenceStore) { try { ((IPersistentPreferenceStore)store).save(); } catch (IOException e) { Activator.logError(Activator.getResourceString("easyshell.message.error.store.save"), e); } } }
private void prefsItemChanged(int findin, MenuItem item) { store.setValue(UIPreferences.FINDTOOLBAR_FIND_IN, findin); if (store.needsSaving()){ try { store.save(); } catch (IOException e) { Activator.handleError(e.getMessage(), e, false); } } commitIdItem.setSelection(false); commentsItem.setSelection(false); authorItem.setSelection(false); committerItem.setSelection(false); item.setSelection(true); clear(); }