/** * Sets the input of the editor's outline page. * * @param page the Java outline page * @param input the editor input */ protected void setOutlinePageInput(JavaOutlinePage page, IEditorInput input) { if (page == null) return; IJavaElement je= getInputJavaElement(); if (je != null && je.exists()) page.setInput(je); else page.setInput(null); }
/** * Creates the outline page used with this editor. * * @return the created Java outline page */ protected JavaOutlinePage createOutlinePage() { JavaOutlinePage page= new JavaOutlinePage(fOutlinerContextMenuId, this); setOutlinePageInput(page, getEditorInput()); return page; }
@Override public void elementChanged(final ElementChangedEvent e) { if (getControl() == null) return; Display d= getControl().getDisplay(); if (d != null) { d.asyncExec(new Runnable() { @Override public void run() { ICompilationUnit cu= (ICompilationUnit) fInput; IJavaElement base= cu; if (fTopLevelTypeOnly) { base= cu.findPrimaryType(); if (base == null) { if (fOutlineViewer != null) fOutlineViewer.refresh(true); return; } } IJavaElementDelta delta= findElement(base, e.getDelta()); if (delta != null && fOutlineViewer != null) { fOutlineViewer.reconcile(delta); } } }); } }
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; }
public void setInput(IJavaElement inputElement) { fInput= inputElement; if (fOutlineViewer != null) { fOutlineViewer.setInput(fInput); updateSelectionProvider(getSite()); } if (fCategoryFilterActionGroup != null) fCategoryFilterActionGroup.setInput(new IJavaElement[] {fInput}); }
initDragAndDrop(); fOutlineViewer.setContentProvider(new ChildrenProvider()); fOutlineViewer.setLabelProvider(new DecoratingJavaLabelProvider(lprovider)); tree.setMenu(fMenu); IPageSite site= getSite(); site.registerContextMenu(JavaPlugin.getPluginId() + ".outline", manager, fOutlineViewer); //$NON-NLS-1$ updateSelectionProvider(site); registerToolbarActions(actionBars);
@Override protected void activate(ISelection selection) { fEditor.doSelectionChanged(selection); getSite().getPage().activate(fEditor); }
protected void contextMenuAboutToShow(IMenuManager menu) { JavaPlugin.createStandardGroups(menu); IStructuredSelection selection= (IStructuredSelection)getSelection(); fActionGroups.setContext(new ActionContext(selection)); fActionGroups.fillContextMenu(menu); }
/** * Convenience method to add the action installed under the given actionID to the * specified group of the menu. * * @param menu the menu manager * @param group the group to which to add the action * @param actionID the ID of the new action */ protected void addAction(IMenuManager menu, String group, String actionID) { IAction action= getAction(actionID); if (action != null) { if (action instanceof IUpdate) ((IUpdate) action).update(); if (action.isEnabled()) { IMenuManager subMenu= menu.findMenuUsingPath(group); if (subMenu != null) subMenu.add(action); else menu.appendToGroup(group, action); } } }
initDragAndDrop(); fOutlineViewer.setContentProvider(new ChildrenProvider()); fOutlineViewer.setLabelProvider(new DecoratingJavaLabelProvider(lprovider)); tree.setMenu(fMenu); IPageSite site= getSite(); site.registerContextMenu(JavaPlugin.getPluginId() + ".outline", manager, fOutlineViewer); //$NON-NLS-1$ updateSelectionProvider(site); registerToolbarActions(actionBars);
public void setInput(IJavaElement inputElement) { fInput= inputElement; if (fOutlineViewer != null) { fOutlineViewer.setInput(fInput); updateSelectionProvider(getSite()); } if (fCategoryFilterActionGroup != null) fCategoryFilterActionGroup.setInput(new IJavaElement[] {fInput}); }
@Override @SuppressWarnings("unchecked") public <T> T getAdapter(Class<T> key) { if (key == IShowInSource.class) { return (T) getShowInSource(); } if (key == IShowInTargetList.class) { return (T) new IShowInTargetList() { @Override public String[] getShowInTargetIds() { return new String[] { JavaUI.ID_PACKAGES }; } }; } if (key == IShowInTarget.class) { return (T) getShowInTarget(); } return null; }
@Override protected void open(ISelection selection, boolean activate) { fEditor.doSelectionChanged(selection); if (activate) getSite().getPage().activate(fEditor); }
protected void contextMenuAboutToShow(IMenuManager menu) { JavaPlugin.createStandardGroups(menu); IStructuredSelection selection= (IStructuredSelection)getSelection(); fActionGroups.setContext(new ActionContext(selection)); fActionGroups.fillContextMenu(menu); }
/** * Convenience method to add the action installed under the given actionID to the * specified group of the menu. * * @param menu the menu manager * @param group the group to which to add the action * @param actionID the ID of the new action */ protected void addAction(IMenuManager menu, String group, String actionID) { IAction action= getAction(actionID); if (action != null) { if (action instanceof IUpdate) ((IUpdate) action).update(); if (action.isEnabled()) { IMenuManager subMenu= menu.findMenuUsingPath(group); if (subMenu != null) subMenu.add(action); else menu.appendToGroup(group, action); } } }
initDragAndDrop(); fOutlineViewer.setContentProvider(new ChildrenProvider()); fOutlineViewer.setLabelProvider(new DecoratingJavaLabelProvider(lprovider)); tree.setMenu(fMenu); IPageSite site= getSite(); site.registerContextMenu(JavaPlugin.getPluginId() + ".outline", manager, fOutlineViewer); //$NON-NLS-1$ updateSelectionProvider(site); registerToolbarActions(actionBars);
public void setInput(IJavaElement inputElement) { fInput= inputElement; if (fOutlineViewer != null) { fOutlineViewer.setInput(fInput); updateSelectionProvider(getSite()); } if (fCategoryFilterActionGroup != null) fCategoryFilterActionGroup.setInput(new IJavaElement[] {fInput}); }
@Override @SuppressWarnings("unchecked") public <T> T getAdapter(Class<T> key) { if (key == IShowInSource.class) { return (T) getShowInSource(); } if (key == IShowInTargetList.class) { return (T) new IShowInTargetList() { @Override public String[] getShowInTargetIds() { return new String[] { JavaUI.ID_PACKAGES }; } }; } if (key == IShowInTarget.class) { return (T) getShowInTarget(); } return null; }
@Override public ShowInContext getShowInContext() { return new ShowInContext( null, getSite().getSelectionProvider().getSelection()); } };
/** * Sets the input of the editor's outline page. * * @param page the Java outline page * @param input the editor input */ protected void setOutlinePageInput(JavaOutlinePage page, IEditorInput input) { if (page == null) return; IJavaElement je= getInputJavaElement(); if (je != null && je.exists()) page.setInput(je); else page.setInput(null); }