private ShowActionGroup(IWorkbenchSite site) { fShowInPackagesViewAction= new ShowInPackageViewAction(site); fShowInPackagesViewAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SHOW_IN_PACKAGE_VIEW); initialize(site , false); }
@Override public void run(IStructuredSelection selection) { if (!checkEnabled(selection)) return; run((IJavaElement)selection.getFirstElement()); }
@Override public void selectionChanged(IStructuredSelection selection) { setEnabled(checkEnabled(selection)); }
@Override public void run(ITextSelection selection) { try { IJavaElement element= SelectionConverter.getElementAtOffset(fEditor); if (element != null) run(element); } catch (JavaModelException e) { JavaPlugin.log(e); String message= ActionMessages.ShowInPackageViewAction_error_message; ErrorDialog.openError(getShell(), getDialogTitle(), message, e.getStatus()); } }
/** * Creates a new <code>ShowInPackageViewAction</code>. The action requires * that the selection provided by the site's selection provider is of type * <code>org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param site the site providing context information for this action */ public ShowInPackageViewAction(IWorkbenchSite site) { super(site); setText(ActionMessages.ShowInPackageViewAction_label); setDescription(ActionMessages.ShowInPackageViewAction_description); setToolTipText(ActionMessages.ShowInPackageViewAction_tooltip); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.SHOW_IN_PACKAGEVIEW_ACTION); }
private void handleGoToPackage(ISelection selection) { IPackageFragment frag = getPackageFragment(selection); if (frag != null) try { IViewPart part = PDEPlugin.getActivePage().showView(JavaUI.ID_PACKAGES); ShowInPackageViewAction action = new ShowInPackageViewAction(part.getSite()); action.run(frag); } catch (PartInitException e) { } }
/** * @deprecated As of 3.5, got replaced by generic Navigate > Show In > */ @Deprecated private void createDeprecatedShowInPackageExplorerAction() { IAction action= new org.eclipse.jdt.ui.actions.ShowInPackageViewAction(this); action.setActionDefinitionId(IJavaEditorActionDefinitionIds.SHOW_IN_PACKAGE_VIEW); setAction("ShowInPackageView", action); //$NON-NLS-1$ }
/** * Note: This constructor is for internal use only. Clients should not call this constructor. * @param editor the Java editor */ public ShowInPackageViewAction(JavaEditor editor) { this(editor.getEditorSite()); fEditor= editor; setEnabled(SelectionConverter.canOperateOn(fEditor)); }
@Override public void run(ITextSelection selection) { try { IJavaElement element= SelectionConverter.getElementAtOffset(fEditor); if (element != null) run(element); } catch (JavaModelException e) { JavaPlugin.log(e); String message= ActionMessages.ShowInPackageViewAction_error_message; ErrorDialog.openError(getShell(), getDialogTitle(), message, e.getStatus()); } }
/** * Creates a new <code>ShowInPackageViewAction</code>. The action requires * that the selection provided by the site's selection provider is of type * <code>org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param site the site providing context information for this action */ public ShowInPackageViewAction(IWorkbenchSite site) { super(site); setText(ActionMessages.ShowInPackageViewAction_label); setDescription(ActionMessages.ShowInPackageViewAction_description); setToolTipText(ActionMessages.ShowInPackageViewAction_tooltip); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.SHOW_IN_PACKAGEVIEW_ACTION); }
private void handleGoToPackage(ISelection selection) { IPackageFragment frag = getPackageFragment(selection); if (frag != null) try { IViewPart part = PDEPlugin.getActivePage().showView(JavaUI.ID_PACKAGES); ShowInPackageViewAction action = new ShowInPackageViewAction(part.getSite()); action.run(frag); } catch (PartInitException e) { } }
/** * @deprecated As of 3.5, got replaced by generic Navigate > Show In > */ @Deprecated private void createDeprecatedShowInPackageExplorerAction() { IAction action= new org.eclipse.jdt.ui.actions.ShowInPackageViewAction(this); action.setActionDefinitionId(IJavaEditorActionDefinitionIds.SHOW_IN_PACKAGE_VIEW); setAction("ShowInPackageView", action); //$NON-NLS-1$ }
/** * Note: This constructor is for internal use only. Clients should not call this constructor. * @param editor the Java editor * * @noreference This constructor is not intended to be referenced by clients. */ public ShowInPackageViewAction(JavaEditor editor) { this(editor.getEditorSite()); fEditor= editor; setEnabled(SelectionConverter.canOperateOn(fEditor)); }
public void run(ITextSelection selection) { try { IJavaElement element= SelectionConverter.getElementAtOffset(fEditor); if (element != null) run(element); } catch (JavaModelException e) { JavaPlugin.log(e); String message= ActionMessages.ShowInPackageViewAction_error_message; ErrorDialog.openError(getShell(), getDialogTitle(), message, e.getStatus()); } }
private ShowActionGroup(IWorkbenchSite site) { fShowInPackagesViewAction= new ShowInPackageViewAction(site); fShowInPackagesViewAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SHOW_IN_PACKAGE_VIEW); initialize(site , false); }
/** * Creates a new <code>ShowInPackageViewAction</code>. The action requires * that the selection provided by the site's selection provider is of type * <code>org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param site the site providing context information for this action */ public ShowInPackageViewAction(IWorkbenchSite site) { super(site); setText(ActionMessages.ShowInPackageViewAction_label); setDescription(ActionMessages.ShowInPackageViewAction_description); setToolTipText(ActionMessages.ShowInPackageViewAction_tooltip); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.SHOW_IN_PACKAGEVIEW_ACTION); }
@Override protected void open2() { IResource res = fHeader.getBundle().getModel().getUnderlyingResource(); if (res == null) return; IPackageFragment frag = PDEJavaHelper.getPackageFragment(fElement, null, res.getProject()); if (frag == null) return; try { IViewPart part = PDEPlugin.getActivePage().showView(JavaUI.ID_PACKAGES); ShowInPackageViewAction action = new ShowInPackageViewAction(part.getSite()); action.run(frag); } catch (PartInitException e) { PDEPlugin.logException(e); } }
public void run(IStructuredSelection selection) { if (!checkEnabled(selection)) return; run((IJavaElement)selection.getFirstElement()); }
@Override public void selectionChanged(IStructuredSelection selection) { setEnabled(checkEnabled(selection)); }
setAction("AnnotationAction", action); //$NON-NLS-1$ action= new ShowInPackageViewAction(this); action.setActionDefinitionId(IJavaEditorActionDefinitionIds.SHOW_IN_PACKAGE_VIEW); setAction("ShowInPackageView", action); //$NON-NLS-1$