public void onConfigChanged(ConfigChangedEvent event) { // force a refresh of the page lastObject = null; myPage.getSite().getShell().getDisplay().asyncExec(new Runnable() { public void run() { myPage.setPropertySourceProvider(RepositoryPropertySourceProvider.this); } }); } });
@Override public void run() { new BranchConfigurationDialog(source.myPage.getSite().getShell(), source.myBranchName, source.myRepository).open(); source.myPage.refresh(); }
@Override public void run() { final StoredConfig config; DisplayMode mode = source.getCurrentMode(); switch (mode) { case EFFECTIVE: return; case SYSTEM: config = source.systemConfig; break; case USER: config = source.userHomeConfig; break; case REPO: config = source.repositoryConfig; break; default: return; } new EditDialog(source.myPage.getSite().getShell(), (FileBasedConfig) config, mode.getText()).open(); source.myPage.refresh(); }
private void checkChangeType(SourceType type) { // the different pages contribute different actions, so if we // change to a different page type, we need to clear them if (lastSourceType != type) { IToolBarManager mgr = myPage.getSite().getActionBars() .getToolBarManager(); boolean update = false; update = update | mgr.remove(RepositoryPropertySource.CHANGEMODEACTIONID) != null; update = update | mgr.remove(RepositoryPropertySource.SINGLEVALUEACTIONID) != null; update = update | mgr.remove(RepositoryPropertySource.EDITACTIONID) != null; update = update | mgr.remove(BranchPropertySource.EDITACTIONID) != null; if (update) mgr.update(false); } lastSourceType = type; } }
/** * @param repository * the repository * @param fullBranchName * the full name of the branch to show * @param page * the page showing the properties */ public BranchPropertySource(Repository repository, String fullBranchName, PropertySheetPage page) { myPage = page; myBranchName = Repository.shortenRefName(fullBranchName); myRepository = repository; synchronized (myPage) { // check if the actions are already there, if not, create them IActionBars bars = myPage.getSite().getActionBars(); IToolBarManager mgr = bars.getToolBarManager(); editAction = ((ActionContributionItem) mgr.find(EDITACTIONID)); if (editAction != null) ((EditAction) editAction.getAction()).setSource(this); else { editAction = new ActionContributionItem(new EditAction( UIText.RepositoryPropertySource_EditConfigButton, UIIcons.EDITCONFIG, this)); mgr.add(new Separator()); mgr.add(editAction); } mgr.update(false); } }
IActionBars bars = myPage.getSite().getActionBars();