/** * Set input to the given input. * * @param input the input for the view * @since 3.4 */ public void setInput(BrowserInput input) { fCurrent= input; Object inputElement= input.getInputElement(); if (inputElement instanceof IJavaElement) { setInput((IJavaElement) inputElement); } else if (inputElement instanceof URL) { fBrowser.setUrl(((URL) inputElement).toExternalForm()); if (fInputSelectionProvider != null) fInputSelectionProvider.setSelection(new StructuredSelection(inputElement)); } fForthAction.update(); fBackAction.update(); }
@Override protected void createActions() { super.createActions(); fSelectAllAction= new SelectAllAction(getControl(), (SelectionProvider) getSelectionProvider()); fBackAction= new BackAction(); fBackAction.setActionDefinitionId(IWorkbenchCommandConstants.NAVIGATE_BACK); fForthAction= new ForthAction(); fForthAction.setActionDefinitionId(IWorkbenchCommandConstants.NAVIGATE_FORWARD); fInputSelectionProvider= new SimpleSelectionProvider(); fOpenBrowserAction= new OpenInBrowserAction(getSite()); fOpenBrowserAction.setSpecialSelectionProvider(fInputSelectionProvider); fOpenBrowserAction.setImageDescriptor(JavaPluginImages.DESC_ELCL_OPEN_BROWSER); fOpenBrowserAction.setDisabledImageDescriptor(JavaPluginImages.DESC_DLCL_OPEN_BROWSER); fOpenBrowserAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_ATTACHED_JAVADOC); fInputSelectionProvider.addSelectionChangedListener(fOpenBrowserAction); IJavaElement input= getOrignalInput(); StructuredSelection selection; if (input != null) { selection= new StructuredSelection(input); } else { selection= new StructuredSelection(); } fInputSelectionProvider.setSelection(selection); }
@Override protected void createActions() { super.createActions(); fSelectAllAction= new SelectAllAction(getControl(), (SelectionProvider) getSelectionProvider()); fBackAction= new BackAction(); fBackAction.setActionDefinitionId(IWorkbenchCommandConstants.NAVIGATE_BACK); fForthAction= new ForthAction(); fForthAction.setActionDefinitionId(IWorkbenchCommandConstants.NAVIGATE_FORWARD); fInputSelectionProvider= new SimpleSelectionProvider(); fOpenBrowserAction= new OpenInBrowserAction(getSite()); fOpenBrowserAction.setSpecialSelectionProvider(fInputSelectionProvider); fOpenBrowserAction.setImageDescriptor(JavaPluginImages.DESC_ELCL_OPEN_BROWSER); fOpenBrowserAction.setDisabledImageDescriptor(JavaPluginImages.DESC_DLCL_OPEN_BROWSER); fOpenBrowserAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_ATTACHED_JAVADOC); fInputSelectionProvider.addSelectionChangedListener(fOpenBrowserAction); IJavaElement input= getOrignalInput(); StructuredSelection selection; if (input != null) { selection= new StructuredSelection(input); } else { selection= new StructuredSelection(); } fInputSelectionProvider.setSelection(selection); }
/** * Set input to the given input. * * @param input the input for the view * @since 3.4 */ public void setInput(BrowserInput input) { fCurrent= input; Object inputElement= input.getInputElement(); if (inputElement instanceof IJavaElement) { setInput((IJavaElement) inputElement); } else if (inputElement instanceof URL) { fBrowser.setUrl(((URL) inputElement).toExternalForm()); if (fInputSelectionProvider != null) fInputSelectionProvider.setSelection(new StructuredSelection(inputElement)); } fForthAction.update(); fBackAction.update(); }
@Override public boolean handleExternalLink(final URL url, Display display) { if (fCurrent == null || !(fCurrent.getInputElement() instanceof URL && url.toExternalForm().equals(((URL) fCurrent.getInputElement()).toExternalForm()))) { fCurrent= new URLBrowserInput(fCurrent, url); if (fBackAction != null) { fBackAction.update(); fForthAction.update(); } if (fInputSelectionProvider != null) fInputSelectionProvider.setSelection(new StructuredSelection(url)); } return false; }
@Override public boolean handleExternalLink(final URL url, Display display) { if (fCurrent == null || !(fCurrent.getInputElement() instanceof URL && url.toExternalForm().equals(((URL) fCurrent.getInputElement()).toExternalForm()))) { fCurrent= new URLBrowserInput(fCurrent, url); if (fBackAction != null) { fBackAction.update(); fForthAction.update(); } if (fInputSelectionProvider != null) fInputSelectionProvider.setSelection(new StructuredSelection(url)); } return false; }
@Override public void handleTextSet() { IJavaElement input= getOrignalInput(); if (input == null) return; if (fCurrent == null || !fCurrent.getInputElement().equals(input)) { fCurrent= new JavaElementBrowserInput(null, input); if (fBackAction != null) { fBackAction.update(); fForthAction.update(); } } } }));
@Override public void handleTextSet() { IJavaElement input= getOrignalInput(); if (input == null) return; if (fCurrent == null || !fCurrent.getInputElement().equals(input)) { fCurrent= new JavaElementBrowserInput(null, input); if (fBackAction != null) { fBackAction.update(); fForthAction.update(); } } } }));
public void update() { if (fCurrent != null && fCurrent.getNext() != null) { BrowserInput element= fCurrent.getNext(); setToolTipText(Messages.format(InfoViewMessages.JavadocView_action_forward_enabledTooltip, BasicElementLabels.getJavaElementName(element.getInputName()))); setEnabled(true); } else { setToolTipText(InfoViewMessages.JavadocView_action_forward_disabledTooltip); setEnabled(false); } }
public ForthAction() { setText(InfoViewMessages.JavadocView_action_forward_name); ISharedImages images= PlatformUI.getWorkbench().getSharedImages(); setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD)); setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED)); update(); }
public ForthAction() { setText(InfoViewMessages.JavadocView_action_forward_name); ISharedImages images= PlatformUI.getWorkbench().getSharedImages(); setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD)); setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED)); update(); }
public void update() { if (fCurrent != null && fCurrent.getNext() != null) { BrowserInput element= fCurrent.getNext(); setToolTipText(Messages.format(InfoViewMessages.JavadocView_action_forward_enabledTooltip, BasicElementLabels.getJavaElementName(element.getInputName()))); setEnabled(true); } else { setToolTipText(InfoViewMessages.JavadocView_action_forward_disabledTooltip); setEnabled(false); } }