/** * @return whether following renames is currently enabled */ protected boolean getFollowRenames() { return store.getBoolean(UIPreferences.RESOURCEHISTORY_FOLLOW_RENAMES); }
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; }
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 propertyChange(final PropertyChangeEvent event) { if (prefName.equals(event.getProperty())) { setChecked(store.getBoolean(prefName)); apply(isChecked()); } }
public void propertyChange(final PropertyChangeEvent event) { if (prefName.equals(event.getProperty())) { setChecked(historyPage.store.getBoolean(prefName)); apply(isChecked()); } }
BooleanPrefAction(final String pn, final String text) { setText(text); prefName = pn; historyPage.store.addPropertyChangeListener(this); setChecked(historyPage.store.getBoolean(prefName)); }
/** * @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)); }
private void setWalkStartPoints(RevWalk walk, Repository db, AnyObjectId headId) { try { if (store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES)) { markStartAllRefs(walk, Constants.R_HEADS); markStartAllRefs(walk, Constants.R_REMOTES); markStartAllRefs(walk, Constants.R_TAGS); } if (store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ADDITIONAL_REFS)) markStartAdditionalRefs(walk); if (store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_NOTES)) markStartAllRefs(walk, Constants.R_NOTES); else markUninteresting(walk, Constants.R_NOTES); walk.markStart(walk.parseCommit(headId)); } catch (IOException e) { throw new IllegalStateException(NLS.bind( UIText.GitHistoryPage_errorSettingStartPoints, Activator .getDefault().getRepositoryUtil() .getRepositoryName(db)), e); } }
private TreeWalk createFileWalker(RevWalk walk, Repository db, List<FilterPath> paths) { final TreeWalk fileWalker = new TreeWalk(db); fileWalker.setRecursive(true); fileWalker.setFilter(TreeFilter.ANY_DIFF); if (store.getBoolean(UIPreferences.RESOURCEHISTORY_FOLLOW_RENAMES) && !paths.isEmpty() && allRegularFiles(paths)) { pathFilters = paths; List<String> selectedPaths = new ArrayList<String>(paths.size()); for (FilterPath filterPath : paths) selectedPaths.add(filterPath.getPath()); fileViewerInterestingPaths = new HashSet<String>(selectedPaths); TreeFilter followFilter = createFollowFilterFor(selectedPaths); walk.setTreeFilter(followFilter); } else if (paths.size() > 0) { pathFilters = paths; List<String> stringPaths = new ArrayList<String>(paths.size()); for (FilterPath p : paths) stringPaths.add(p.getPath()); walk.setTreeFilter(AndTreeFilter.create(PathFilterGroup .createFromStrings(stringPaths), TreeFilter.ANY_DIFF)); fileViewerInterestingPaths = new HashSet<String>(stringPaths); } else { pathFilters = null; walk.setTreeFilter(TreeFilter.ALL); fileViewerInterestingPaths = null; } return fileWalker; }
boolean keepOnWarning = prefStore.getBoolean(IDEInternalPreferences.WARN_ABOUT_WORKSPACE_INCOMPATIBILITY); if (keepOnWarning) { MessageDialogWithToggle dialog = new MessageDialogWithToggle(shell, title, null, message, severity,
private void layout() { final boolean showComment = store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_REV_COMMENT); final boolean showFiles = store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_REV_DETAIL); final boolean showFindToolbar = store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_FINDTOOLBAR); if (showComment && showFiles) { graphDetailSplit.setMaximizedControl(null); revInfoSplit.setMaximizedControl(null); } else if (showComment && !showFiles) { graphDetailSplit.setMaximizedControl(null); revInfoSplit.setMaximizedControl(commentViewer.getControl()); } else if (!showComment && showFiles) { graphDetailSplit.setMaximizedControl(null); revInfoSplit.setMaximizedControl(fileViewer.getControl()); } else if (!showComment && !showFiles) graphDetailSplit.setMaximizedControl(graph.getControl()); if (showFindToolbar) ((GridData) findToolbar.getLayoutData()).heightHint = SWT.DEFAULT; else { ((GridData) findToolbar.getLayoutData()).heightHint = 0; findToolbar.clear(); } historyControl.layout(); }
private SWTWalk createNewWalk(Repository db, AnyObjectId headId) { currentHeadId = headId; SWTWalk walk = new SWTWalk(db); try { if (store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ADDITIONAL_REFS)) walk.addAdditionalRefs(db.getRefDatabase() .getAdditionalRefs()); walk.addAdditionalRefs(db.getRefDatabase() .getRefs(Constants.R_NOTES).values()); } catch (IOException e) { throw new IllegalStateException(NLS.bind( UIText.GitHistoryPage_errorReadingAdditionalRefs, Activator .getDefault().getRepositoryUtil() .getRepositoryName(db)), e); } walk.sort(RevSort.COMMIT_TIME_DESC, true); walk.sort(RevSort.BOUNDARY, true); walk.setRetainBody(false); return walk; }
.getBoolean(UIPreferences.FINDTOOLBAR_IGNORE_CASE));