use of org.eclipse.wst.sse.ui.internal.StructuredTextViewer in project webtools.sourceediting by eclipse.
the class TestViewerConfigurationCSS method setUpViewerConfiguration.
private void setUpViewerConfiguration() {
if (Display.getCurrent() != null) {
Shell shell = null;
Composite parent = null;
if (PlatformUI.isWorkbenchRunning()) {
shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
} else {
shell = new Shell(Display.getCurrent());
}
parent = new Composite(shell, SWT.NONE);
// dummy viewer
fViewer = new StructuredTextViewer(parent, null, null, false, SWT.NONE);
fConfig = new StructuredTextViewerConfigurationCSS();
} else {
fDisplayExists = false;
Logger.log(Logger.INFO, "Remember, viewer configuration tests are not run because workbench is not open (normal on build machine)");
}
}
use of org.eclipse.wst.sse.ui.internal.StructuredTextViewer in project webtools.sourceediting by eclipse.
the class StructuredTextEditor method setSourceViewerConfiguration.
/**
* Sets the editor's source viewer configuration which it uses to
* configure it's internal source viewer. This method was overwritten so
* that viewer configuration could be set after editor part was created.
*/
protected void setSourceViewerConfiguration(SourceViewerConfiguration config) {
SourceViewerConfiguration oldSourceViewerConfiguration = getSourceViewerConfiguration();
super.setSourceViewerConfiguration(config);
StructuredTextViewer stv = getTextViewer();
if (stv != null) {
/*
* There should be no need to unconfigure before configure because
* configure will also unconfigure before configuring
*/
removeReconcilingListeners(oldSourceViewerConfiguration, stv);
stv.unconfigure();
setStatusLineMessage(null);
stv.configure(config);
addReconcilingListeners(config, stv);
}
}
use of org.eclipse.wst.sse.ui.internal.StructuredTextViewer in project webtools.sourceediting by eclipse.
the class StructuredTextEditor method endBusyStateInternal.
/**
* Note this method can be called indirectly from background job operation
* ... but expected to be gaurded there with ILock, plus, can be called
* directly from timer thread, so the timer's run method guards with ILock
* too.
*
* Set result[0] to 1 if the busy state was ended successfully
*/
private void endBusyStateInternal(byte[] result) {
if (fBackgroundJobEnded) {
result[0] = 1;
showBusy(false);
ISourceViewer viewer = getSourceViewer();
if (viewer instanceof StructuredTextViewer) {
((StructuredTextViewer) viewer).endBackgroundUpdate();
}
fBusyState = false;
} else {
// we will only be in this branch for a back ground job that is
// taking
// longer than our normal time-out period (meaning we got notified
// of
// the timeout "inbetween" calls to 'begin' and
// 'endBackgroundOperation'.
// (which, remember, can only happen since there are many calls to
// begin/end in a short period of time, and we only "reset" on the
// 'ends').
// In this event, there's really nothing to do, we're still in
// "busy state"
// and should start a new reset cycle once endBackgroundjob is
// called.
}
}
use of org.eclipse.wst.sse.ui.internal.StructuredTextViewer in project webtools.sourceediting by eclipse.
the class StructuredTextEditor method createSourceViewer.
/**
* Creates the source viewer to be used by this editor
*/
protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler verticalRuler, int styles) {
fAnnotationAccess = createAnnotationAccess();
fOverviewRuler = createOverviewRuler(getSharedColors());
StructuredTextViewer sourceViewer = createStructedTextViewer(parent, verticalRuler, styles);
initSourceViewer(sourceViewer);
return sourceViewer;
}
use of org.eclipse.wst.sse.ui.internal.StructuredTextViewer in project webtools.sourceediting by eclipse.
the class TestViewerConfigurationHTML method setUpViewerConfiguration.
private void setUpViewerConfiguration() {
if (Display.getCurrent() != null) {
Shell shell = null;
Composite parent = null;
if (PlatformUI.isWorkbenchRunning()) {
shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
} else {
shell = new Shell(Display.getCurrent());
}
parent = new Composite(shell, SWT.NONE);
// dummy viewer
fViewer = new StructuredTextViewer(parent, null, null, false, SWT.NONE);
fConfig = new StructuredTextViewerConfigurationHTML();
} else {
fDisplayExists = false;
Logger.log(Logger.INFO, "Remember, viewer configuration tests are not run because workbench is not open (normal on build machine)");
}
}
Aggregations