@Override public int getCurrentPageIndex() { IConsole currentConsole= getConsole(); IConsole[] consoles= getConsoleManager().getConsoles(); for (int i= 0; i < consoles.length; i++) { if (consoles[i].equals(currentConsole)) { return i; } } return super.getCurrentPageIndex(); } };
public void propertyChange(PropertyChangeEvent event) { Object source = event.getSource(); if (source instanceof IConsole && event.getProperty().equals(IBasicPropertyConstants.P_TEXT)) { if (source.equals(getConsole())) { updateTitle(); } } }
@Override public void propertyChange(PropertyChangeEvent event) { Object source = event.getSource(); if (source instanceof IConsole && event.getProperty().equals(IBasicPropertyConstants.P_TEXT)) { if (source.equals(getConsole())) { updateTitle(); } } }
public void run() { for (int i = 0; i < consoles.length; i++) { if (isAvailable()) { IConsole console = consoles[i]; fStack.remove(console); ConsoleWorkbenchPart part = (ConsoleWorkbenchPart)fConsoleToPart.get(console); if (part != null) { partClosed(part); } if (getConsole() == null) { IConsole[] available = getConsoleManager().getConsoles(); if (available.length > 0) { display(available[available.length - 1]); } } } } } };
@Override public void run() { for (int i = 0; i < consoles.length; i++) { if (isAvailable()) { IConsole console = consoles[i]; fStack.remove(console); ConsoleWorkbenchPart part = fConsoleToPart.get(console); if (part != null) { partClosed(part); } if (getConsole() == null) { IConsole[] available = getConsoleManager().getConsoles(); if (available.length > 0) { display(available[available.length - 1]); } } } } } };
@SuppressWarnings("unchecked") @Override public <T> T getAdapter(Class<T> key) { Object adpater = super.getAdapter(key); if (adpater == null) { IConsole console = getConsole(); if (console != null) { ListenerList<IConsolePageParticipant> listeners = getParticipants(console); // an adapter can be asked for before the console participants are created if (listeners != null) { for (IConsolePageParticipant iConsolePageParticipant : listeners) { IConsolePageParticipant participant = iConsolePageParticipant; adpater = participant.getAdapter(key); if (adpater != null) { return (T) adpater; } } } } } return (T) adpater; }
/** * Updates the view title based on the active console */ protected void updateTitle() { IConsole console = getConsole(); if (console == null) { setContentDescription(ConsoleMessages.ConsoleView_0); } else { String newName = console.getName(); String oldName = getContentDescription(); if (newName!=null && !(newName.equals(oldName))) { setContentDescription(console.getName()); } } }
/** * Updates the view title based on the active console */ protected void updateTitle() { IConsole console = getConsole(); if (console == null) { setContentDescription(ConsoleMessages.ConsoleView_0); } else { String newName = console.getName(); String oldName = getContentDescription(); if (newName!=null && !(newName.equals(oldName))) { setContentDescription(console.getName()); } } }
public Object getAdapter(Class key) { Object adpater = super.getAdapter(key); if (adpater == null) { IConsole console = getConsole(); if (console != null) { ListenerList listeners = getParticipants(console); // an adapter can be asked for before the console participants are created if (listeners != null) { Object[] participants = listeners.getListeners(); for (int i = 0; i < participants.length; i++) { IConsolePageParticipant participant = (IConsolePageParticipant) participants[i]; adpater = participant.getAdapter(key); if (adpater != null) { return adpater; } } } } } return adpater; }
public IStatus runInUIThread(IProgressMonitor monitor) { synchronized (list) { if (list.isEmpty()) { return Status.OK_STATUS; } IWorkbenchWindow[] workbenchWindows = PlatformUI.getWorkbench().getWorkbenchWindows(); for (int i = 0; i < workbenchWindows.length; i++) { IWorkbenchWindow window = workbenchWindows[i]; if (window != null) { IWorkbenchPage page = window.getActivePage(); if (page != null) { IViewPart part = page.findView(IConsoleConstants.ID_CONSOLE_VIEW); if (part != null && part instanceof IConsoleView) { ConsoleView view = (ConsoleView) part; if (list.contains(view.getConsole())) { Control control = view.getCurrentPage().getControl(); if (!control.isDisposed()) { control.redraw(); } } } } } } list.clear(); } return Status.OK_STATUS; } }
@Override public IStatus runInUIThread(IProgressMonitor monitor) { synchronized (list) { if (list.isEmpty()) { return Status.OK_STATUS; } IWorkbenchWindow[] workbenchWindows = PlatformUI.getWorkbench().getWorkbenchWindows(); for (int i = 0; i < workbenchWindows.length; i++) { IWorkbenchWindow window = workbenchWindows[i]; if (window != null) { IWorkbenchPage page = window.getActivePage(); if (page != null) { IViewPart part = page.findView(IConsoleConstants.ID_CONSOLE_VIEW); if (part != null && part instanceof IConsoleView) { ConsoleView view = (ConsoleView) part; if (list.contains(view.getConsole())) { Control control = view.getCurrentPage().getControl(); if (!control.isDisposed()) { control.redraw(); } } } } } } list.clear(); } return Status.OK_STATUS; } }
protected void updateHelp() { IConsole console = getConsole(); String helpContextId = null; if (console instanceof AbstractConsole) { AbstractConsole abs = (AbstractConsole) console; helpContextId = abs.getHelpContextId(); } if (helpContextId == null) { helpContextId = IConsoleHelpContextIds.CONSOLE_VIEW; } PlatformUI.getWorkbench().getHelpSystem().setHelp(getPageBook().getParent(), helpContextId); }
protected void updateHelp() { IConsole console = getConsole(); String helpContextId = null; if (console instanceof AbstractConsole) { AbstractConsole abs = (AbstractConsole) console; helpContextId = abs.getHelpContextId(); } if (helpContextId == null) { helpContextId = IConsoleHelpContextIds.CONSOLE_VIEW; } PlatformUI.getWorkbench().getHelpSystem().setHelp(getPageBook().getParent(), helpContextId); }