use of org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter in project webtools.sourceediting by eclipse.
the class StructuredTextViewerConfiguration method getInformationPresenterControlCreator.
/**
* Returns the information presenter control creator. The creator is a
* factory creating the presenter controls for the given source viewer.
*
* @param sourceViewer
* the source viewer to be configured by this configuration
* @return an information control creator
*/
private IInformationControlCreator getInformationPresenterControlCreator(ISourceViewer sourceViewer) {
return new IInformationControlCreator() {
public IInformationControl createInformationControl(Shell parent) {
int shellStyle = SWT.RESIZE | SWT.TOOL;
int style = SWT.V_SCROLL | SWT.H_SCROLL;
return new DefaultInformationControl(parent, shellStyle, style, new HTMLTextPresenter(false));
}
};
}
use of org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter in project webtools.sourceediting by eclipse.
the class StructuredTextEditor method createPartControl.
/**
* {@inheritDoc}
* <p>
* Use StructuredTextViewerConfiguration if a viewerconfiguration has not
* already been set. Also initialize StructuredTextViewer.
* </p>
*
* @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createPartControl(org.eclipse.swt.widgets.Composite)
*/
public void createPartControl(Composite parent) {
IContextService contextService = getSite().getService(IContextService.class);
if (contextService != null)
contextService.activateContext(EDITOR_KEYBINDING_SCOPE_ID);
if (getSourceViewerConfiguration() == null) {
ConfigurationAndTarget cat = createSourceViewerConfiguration();
fViewerConfigurationTargetId = cat.getTargetId();
StructuredTextViewerConfiguration newViewerConfiguration = cat.getConfiguration();
setSourceViewerConfiguration(newViewerConfiguration);
}
super.createPartControl(parent);
// instead of calling setInput twice, use initializeSourceViewer() to
// handle source viewer initialization previously handled by setInput
initializeSourceViewer();
// update editor context menu, vertical ruler context menu, infopop
if (getInternalModel() != null) {
updateEditorControlsForContentType(getInternalModel().getContentTypeIdentifier());
} else {
updateEditorControlsForContentType(null);
}
// used for Show Tooltip Description
IInformationControlCreator informationControlCreator = new IInformationControlCreator() {
public IInformationControl createInformationControl(Shell shell) {
boolean cutDown = false;
int style = cutDown ? SWT.NONE : (SWT.V_SCROLL | SWT.H_SCROLL);
return new DefaultInformationControl(shell, SWT.RESIZE | SWT.TOOL, style, new HTMLTextPresenter(cutDown));
}
};
fInformationPresenter = new InformationPresenter(informationControlCreator);
fInformationPresenter.setSizeConstraints(60, 10, true, true);
fInformationPresenter.install(getSourceViewer());
addReconcilingListeners(getSourceViewerConfiguration(), getTextViewer());
fPartListener = new PartListener(this);
getSite().getWorkbenchWindow().getPartService().addPartListener(fPartListener);
installSemanticHighlighting();
if (fOutlineHandler != null) {
IInformationPresenter presenter = configureOutlinePresenter(getSourceViewer(), getSourceViewerConfiguration());
if (presenter != null) {
presenter.install(getSourceViewer());
fOutlineHandler.configure(presenter);
}
}
installCharacterPairing();
ISourceViewer viewer = getSourceViewer();
if (viewer instanceof ITextViewerExtension) {
((ITextViewerExtension) viewer).appendVerifyKeyListener(fPairInserter);
fPairInserter.installCompletionListener();
}
if (Platform.getProduct() != null) {
// $NON-NLS-1$);
String viewID = Platform.getProduct().getProperty("idPerspectiveHierarchyView");
if (viewID != null) {
// make sure the specified view ID is known
if (PlatformUI.getWorkbench().getViewRegistry().find(viewID) != null) {
fShowInTargetIds = new String[] { viewID, IPageLayout.ID_PROJECT_EXPLORER, IPageLayout.ID_RES_NAV, IPageLayout.ID_OUTLINE };
}
}
}
}
Aggregations