@Override public void propertyChange(PropertyChangeEvent event) { if (PreferenceConstants.APPEARANCE_JAVADOC_FONT.equals(event.getProperty())) { fgStyleSheetLoaded= false; // trigger reloading, but make sure other listeners have already run, so that // the style sheet gets reloaded only once. final Display display= getSite().getPage().getWorkbenchWindow().getWorkbench().getDisplay(); if (!display.isDisposed()) { display.asyncExec(new Runnable() { @Override public void run() { if (!display.isDisposed()) { initStyleSheet(); refresh(); } } }); } } } };
protected void setInput(Object input) { String javadocHtml= (String)input; if (fIsUsingBrowserWidget) { if (javadocHtml != null && javadocHtml.length() > 0) { boolean RTL= (getSite().getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0; if (RTL) { StringBuffer buffer= new StringBuffer(javadocHtml); HTMLPrinter.insertStyles(buffer, new String[] { "direction:rtl" } ); //$NON-NLS-1$ javadocHtml= buffer.toString(); } } fBrowser.setText(javadocHtml); } else { fPresentation.clear(); Rectangle size= fText.getClientArea(); try { javadocHtml= ((DefaultInformationControl.IInformationPresenterExtension)fPresenter).updatePresentation(getSite().getShell(), javadocHtml, fPresentation, size.width, size.height); } catch (IllegalArgumentException ex) { // the javadoc might no longer be valid return; } fText.setText(javadocHtml); TextPresentation.applyTextPresentation(fPresentation, fText); } }
@Override public void propertyChange(PropertyChangeEvent event) { if (PreferenceConstants.APPEARANCE_JAVADOC_FONT.equals(event.getProperty())) { fgStyleSheetLoaded= false; // trigger reloading, but make sure other listeners have already run, so that // the style sheet gets reloaded only once. final Display display= getSite().getPage().getWorkbenchWindow().getWorkbench().getDisplay(); if (!display.isDisposed()) { display.asyncExec(new Runnable() { @Override public void run() { if (!display.isDisposed()) { initStyleSheet(); refresh(); } } }); } } } };
boolean RTL= (getSite().getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0; if (RTL) { StringBuilder buffer= new StringBuilder(javadocHtml);
boolean RTL= (getSite().getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0; if (RTL) { StringBuffer buffer= new StringBuffer(javadocHtml);
@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); }