@Override public synchronized ICompareNavigator getNavigator() { if (fNavigator == null) fNavigator= new CompareEditorInputNavigator( new Object[] { fStructureInputPane, fStructurePane1, fStructurePane2, fContentInputPane } ); return fNavigator; }
private boolean mustOpen() { Object[] panes = getPanes(); if (panes == null || panes.length == 0) return false; for (int i= 1; i < panes.length; i++) { Object pane= panes[i]; INavigatable nav = getNavigator(pane); if (nav != null && nav.getInput() != null) return false; } return true; }
public boolean selectChange(boolean next) { // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106 if (next && fNextFirstTime && mustOpen()) { fNextFirstTime= false; if (openElement()) return false; } return super.selectChange(next); }
private void feed1(CompareEditorInputNavigator cein) { if (getCompareInput() instanceof PatchFileDiffNode) { Object pane = cein.getPanes()[1]; // the top middle pane if (pane instanceof CompareViewerPane) { CompareViewerPane cvp = (CompareViewerPane) pane; cvp.setInput(getCompareInput()); } pane = cein.getPanes()[2]; // the top right pane if (pane instanceof CompareViewerPane) { CompareViewerPane cvp = (CompareViewerPane) pane; cvp.setInput(null); // clear downstream pane } } } }
@Override protected void contentsCreated() { super.contentsCreated(); ICompareNavigator nav = getNavigator(); if (nav instanceof CompareEditorInputNavigator) { final CompareEditorInputNavigator cein = (CompareEditorInputNavigator) nav; Object pane = cein.getPanes()[0]; // the structure input pane, top left if (pane instanceof CompareViewerPane) { CompareViewerPane cvp = (CompareViewerPane) pane; cvp.setSelection(StructuredSelection.EMPTY); cvp.addSelectionChangedListener(e -> feed1(cein)); feed1(cein); } } }
private boolean openElement() { Object[] panes = getPanes(); if (panes == null || panes.length == 0) return false; INavigatable nav = getNavigator(panes[0]); if (nav != null) return nav.openSelectedChange(); return false; } }
public synchronized ICompareNavigator getNavigator() { if (fNavigator == null) fNavigator= new CompareEditorInputNavigator( new Object[] { fStructureInputPane, fStructurePane1, fStructurePane2, fContentInputPane } ); return fNavigator; }
@Override public boolean selectChange(boolean next) { // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106 if (next && fNextFirstTime && mustOpen()) { fNextFirstTime= false; if (openElement()) return false; } return super.selectChange(next); }
@Override protected INavigatable[] getNavigatables() { List<INavigatable> result = new ArrayList<>(); Object[] panes = getPanes(); for (int i = 0; i < panes.length; i++) { Object pane = panes[i]; INavigatable navigator= getNavigator(pane); if (navigator != null) result.add(navigator); } return result.toArray(new INavigatable[result.size()]); }
/** * This method is internal to the framework and should not be called by clients * outside of the framework. */ protected void setNavigator(ISynchronizePageConfiguration configuration) { configuration.setProperty(SynchronizePageConfiguration.P_NAVIGATOR, new CompareEditorInputNavigator( new Object[] { configuration.getProperty(SynchronizePageConfiguration.P_ADVISOR), fStructuredComparePane, fContentPane } )); }
protected INavigatable[] getNavigatables() { List result = new ArrayList(); Object[] panes = getPanes(); for (int i = 0; i < panes.length; i++) { Object pane = panes[i]; INavigatable navigator= getNavigator(pane); if (navigator != null) result.add(navigator); } return (INavigatable[]) result.toArray(new INavigatable[result.size()]); }
/** * This method is internal to the framework and should not be called by clients * outside of the framework. */ protected void setNavigator(ISynchronizePageConfiguration configuration) { configuration.setProperty(SynchronizePageConfiguration.P_NAVIGATOR, new CompareEditorInputNavigator( new Object[] { configuration.getProperty(SynchronizePageConfiguration.P_ADVISOR), fStructuredComparePane, fContentPane } )); }
private boolean mustOpen() { Object[] panes = getPanes(); if (panes == null || panes.length == 0) return false; for (int i= 1; i < panes.length; i++) { Object pane= panes[i]; INavigatable nav = getNavigator(pane); if (nav != null && nav.getInput() != null) return false; } return true; }
private boolean openElement() { Object[] panes = getPanes(); if (panes == null || panes.length == 0) return false; INavigatable nav = getNavigator(panes[0]); if (nav != null) { if (!nav.openSelectedChange()) // selected change not opened, open first instead nav.selectChange(INavigatable.FIRST_CHANGE); return true; } return false; } }