@Override public Object getAdapter(Class key) { if (key.equals(ISelectionProvider.class)) return fViewer; if (key == IShowInSource.class) { return getShowInSource(); } if (key == IShowInTargetList.class) { return new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { JavaPlugin.ID_RES_NAV }; } }; } if (key == IContextProvider.class) { return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.PACKAGES_VIEW); } return super.getAdapter(key); }
/** * {@inheritDoc} */ @Override public Object getAdapter(Class adapter) { if (adapter == IShowInSource.class) { return getShowInSource(); } if (adapter == IContextProvider.class) { return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.CALL_HIERARCHY_VIEW); } if (adapter == IShowInTargetList.class) { return new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV }; } }; } return super.getAdapter(adapter); }
public Object getAdapter(Class key) { if (key == IShowInSource.class) { return getShowInSource(); } if (key == IShowInTargetList.class) { return new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { JavaUI.ID_PACKAGES }; } }; } if (key == IShowInTarget.class) { return getShowInTarget(); } return null; }
@Override public Object getAdapter(Class key) { if (key == IShowInSource.class) { return getShowInSource(); } if (key == IShowInTargetList.class) { return new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV }; } }; } if (key == IContextProvider.class) { return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.TYPE_HIERARCHY_VIEW); } return super.getAdapter(key); }
@SuppressWarnings("unchecked") @Override public <T> T getAdapter(Class<T> requestedClass) { if (IContentOutlinePage.class.equals(requestedClass)) { IContentOutlinePage outlinePage = this.outlinePage; return (T) outlinePage; } if(requestedClass == IShowInTargetList.class) { return (T) new IShowInTargetList() { @Override public String[] getShowInTargetIds() { return array(IPageLayout.ID_OUTLINE); } }; } return super.getAdapter(requestedClass); }
public Object getAdapter(Class adapter) { if (IShowInTargetList.class.equals(adapter)) { return SHOW_IN_TARGET_LIST; } if (adapter == IShowInSource.class) { ISelectionProvider selectionProvider= getSite().getSelectionProvider(); if (selectionProvider == null) return null; ISelection selection= selectionProvider.getSelection(); if (selection instanceof IStructuredSelection) { IStructuredSelection structuredSelection= ((StructuredSelection)selection); final Set newSelection= new HashSet(structuredSelection.size()); Iterator iter= structuredSelection.iterator(); while (iter.hasNext()) { Object element= iter.next(); if (element instanceof LineElement) element= ((LineElement)element).getParent(); newSelection.add(element); } return new IShowInSource() { public ShowInContext getShowInContext() { return new ShowInContext(null, new StructuredSelection(new ArrayList(newSelection))); } }; } return null; } return null; }
/** * @generated */ @SuppressWarnings("rawtypes") public Object getAdapter(Class type) { if (type == IShowInTargetList.class) { return new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { ProjectExplorer.VIEW_ID }; } }; } return super.getAdapter(type); }
@Override public Object getAdapter(Class adapter) { if (adapter == IShowInTargetList.class) { return new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV }; } }; } return super.getAdapter(adapter); }
@Override public Object getAdapter(Class key) { if (key == IShowInTargetList.class) { return new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV }; } }; } return super.getAdapter(key); }
@Override public Object getAdapter(Class key) { if (key == IShowInTargetList.class) { return new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { JavaUI.ID_PACKAGES }; } }; } return super.getAdapter(key); }
/** * @generated */ public Object getAdapter(Class type) { if (type == IShowInTargetList.class) { return new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { ProjectExplorer.VIEW_ID }; } }; } return super.getAdapter(type); }
public Object getAdapter(Class<?> adapter) { if (IShowInTargetList.class.equals(adapter)) { return SHOW_IN_TARGET_LIST; } if (adapter == IShowInSource.class) { ISelectionProvider selectionProvider = getSite().getSelectionProvider(); if (selectionProvider == null) { return null; } ISelection selection = selectionProvider.getSelection(); if (selection instanceof IStructuredSelection) { IStructuredSelection structuredSelection = ((StructuredSelection) selection); final Set<Object> newSelection = new HashSet<>(structuredSelection.size()); Iterator<?> iter = structuredSelection.iterator(); while (iter.hasNext()) { Object element = iter.next(); if (element instanceof ICustomLineElement) { element = ((ICustomLineElement) element).getParent(); } newSelection.add(element); } return new IShowInSource() { @Override public ShowInContext getShowInContext() { return new ShowInContext(null, new StructuredSelection(new ArrayList<>(newSelection))); } }; } return null; } return null; }
@Override @SuppressWarnings("unchecked") public <T> T getAdapter(Class<T> adapter) { if (IShowInTargetList.class.equals(adapter)) { return (T) SHOW_IN_TARGET_LIST; } return null; }
/** * @generated */ @SuppressWarnings("rawtypes") public Object getAdapterGen(Class type) { if (type == IShowInTargetList.class) { return new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { ProjectExplorer.VIEW_ID }; } }; } return super.getAdapter(type); }