protected boolean isThisPart(IWorkbenchPartReference partRef) { if (partRef instanceof IViewReference) { IViewReference viewRef = (IViewReference) partRef; if (viewRef.getId().equals(getViewSite().getId())) { String secId = viewRef.getSecondaryId(); String mySec = null; if (getSite() instanceof IViewSite) { mySec = ((IViewSite)getSite()).getSecondaryId(); } if (mySec == null) { return secId == null; } return mySec.equals(secId); } } return false; }
@Override public void run() { for (int i = 0; i < consoles.length; i++) { if (isAvailable()) { IConsole console = consoles[i]; // ensure it's still registered since this is done asynchronously IConsole[] allConsoles = getConsoleManager().getConsoles(); for (int j = 0; j < allConsoles.length; j++) { IConsole registered = allConsoles[j]; if (registered.equals(console)) { ConsoleWorkbenchPart part = new ConsoleWorkbenchPart(console, getSite()); fConsoleToPart.put(console, part); fPartToConsole.put(part, console); partActivated(part); break; } } } } } };
public void run() { for (int i = 0; i < consoles.length; i++) { if (isAvailable()) { IConsole console = consoles[i]; // ensure it's still registered since this is done asynchronously IConsole[] allConsoles = getConsoleManager().getConsoles(); for (int j = 0; j < allConsoles.length; j++) { IConsole registered = allConsoles[j]; if (registered.equals(console)) { ConsoleWorkbenchPart part = new ConsoleWorkbenchPart(console, getSite()); fConsoleToPart.put(console, part); fPartToConsole.put(part, console); partActivated(part); break; } } } } } };
/** * Returns if the specified part reference is to this view part (if the part * reference is the console view or not) * * @param partRef the workbench part reference * @return true if the specified part reference is the console view */ protected boolean isThisPart(IWorkbenchPartReference partRef) { if (partRef instanceof IViewReference) { IViewReference viewRef = (IViewReference) partRef; if (getViewSite() != null && viewRef.getId().equals(getViewSite().getId())) { String secId = viewRef.getSecondaryId(); String mySec = null; if (getSite() instanceof IViewSite) { mySec = ((IViewSite)getSite()).getSecondaryId(); } if (mySec == null) { return secId == null; } return mySec.equals(secId); } } return false; }
@Override public void partDeactivated(IWorkbenchPartReference partRef) { if (isThisPart(partRef)) { fActive = false; IContextService contextService = getSite().getService(IContextService.class); if(contextService != null) { contextService.deactivateContext(fActivatedContext); deactivateParticipants(fActiveConsole); } } }
@Override public void setWordWrap(boolean wordWrap) { fWordWrap = wordWrap; IWorkbenchPart part = getSite().getPart(); if (part instanceof PageBookView) { Control control = ((PageBookView) part).getCurrentPage().getControl(); if (control instanceof StyledText) { ((StyledText) control).setWordWrap(wordWrap); } } }
@Override public void partActivated(IWorkbenchPartReference partRef) { if (isThisPart(partRef)) { fActive = true; IContextService contextService = getSite().getService(IContextService.class); if(contextService != null) { fActivatedContext = contextService.activateContext(IConsoleConstants.ID_CONSOLE_VIEW); activateParticipants(fActiveConsole); } } }
for (Iterator iter = fConsoleViews.iterator(); iter.hasNext();) { ConsoleView consoleView = (ConsoleView) iter.next(); if (consoleView.getSite().getPage().equals(page)) { boolean consoleVisible = page.isPartVisible(consoleView); if (consoleVisible) {