public Object getAdapter(Class key) { if (key == IContributedContentsView.class) { return new IContributedContentsView() { public IWorkbenchPart getContributingPart() { return getContributingEditor(); } }; } return super.getAdapter(key); }
public Object getAdapter(Class adapter) { Object superAdapter= super.getAdapter(adapter); if (superAdapter != null) return superAdapter; if (adapter == IShowInSource.class) { return new IShowInSource() { public ShowInContext getShowInContext() { return new ShowInContext(null, getSelectionProvider().getSelection()); } }; } return null; }
@SuppressWarnings("unchecked") @Override public <T> T getAdapter(Class<T> adapter) { Object superAdapter= super.getAdapter(adapter); if (superAdapter != null) return (T) superAdapter; if (adapter == IShowInSource.class) { return (T) new IShowInSource() { @Override public ShowInContext getShowInContext() { return new ShowInContext(null, getSelectionProvider().getSelection()); } }; } return null; }
@Override public <T> T getAdapter(Class<T> key) { if (key == IContributedContentsView.class) { return key.cast(new IContributedContentsView() { @Override public IWorkbenchPart getContributingPart() { return getContributingEditor(); } }); } return super.getAdapter(key); }
@Override public <T> T getAdapter(Class<T> key) { if (key == IContributedContentsView.class) { return key.cast(new IContributedContentsView() { @Override public IWorkbenchPart getContributingPart() { return getContributingEditor(); } }); } return super.getAdapter(key); }
/** * Debug views implement the debug view adapter which * provides access to a view's underlying viewer and * debug model presentation for a specific debug model. * * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see IDebugView */ @SuppressWarnings("unchecked") @Override public <T> T getAdapter(Class<T> adapter) { if (adapter == IDebugView.class) { return (T) this; } if (adapter == IDebugModelPresentation.class) { StructuredViewer viewer = getStructuredViewer(); if (viewer != null) { IBaseLabelProvider labelProvider = viewer.getLabelProvider(); if (labelProvider instanceof IDebugModelPresentation) { return (T) labelProvider; } } } return super.getAdapter(adapter); }
@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; }
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; }