Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Problem with IVerticalRuler - org.eclipse.ui.editors
Problem with IVerticalRuler - org.eclipse.ui.editors [message #605009] Thu, 11 March 2010 12:33
El_justiciero  is currently offline El_justiciero Friend
Messages: 13
Registered: July 2009
Junior Member
Hello everybody,

We have some problems developing our plugin.
Concretely working with the vertical bar (next to the line number bar). Ones we create a new personal file and we show it into our the editor, the vertical bar is not well painting or repainting.

To manage the editor properties we use the next extensions: to debug, to control breakpoints...

http://img717.imageshack.us/i/extensions.jpg/

We thought that the problem come from the method createSourceViewer in the next class, because is into this class where the ruler is used to configure the sourceViewer

public class MyEditor extends TextEditor{

private MyContentOutlinePage fOutlinePage;

private ProjectionSupport fProjectionSupport;

private MyPairMatcher fPairMatcher = new MyPairMatcher();

private MatchingCharacterPainter fMatchingCharacterPainter;

protected MyReconcilingStrategy reconcilingStrategy;


public MyEditor() {
super();
}

public void dispose() {
if (fOutlinePage != null)
fOutlinePage.setInput(null);
super.dispose();
}

public void doRevertToSaved() {
super.doRevertToSaved();
if (fOutlinePage != null)
fOutlinePage.update();
}

public void doSave(IProgressMonitor monitor) {
super.doSave(monitor);
if (fOutlinePage != null)
fOutlinePage.update();
}

public void doSaveAs() {
super.doSaveAs();
if (fOutlinePage != null)
fOutlinePage.update();
}

public void doSetInput(IEditorInput input) throws CoreException {
super.doSetInput(input);
if (fOutlinePage != null)
fOutlinePage.setInput(input);
}

public Object getAdapter(Class required) {
if (IContentOutlinePage.class.equals(required)) {
if (fOutlinePage == null) {
fOutlinePage= new MyContentOutlinePage(getDocumentProvider(), this);
if (getEditorInput() != null)
fOutlinePage.setInput(getEditorInput());
}
return fOutlinePage;
}

if (fProjectionSupport != null) {
Object adapter= fProjectionSupport.getAdapter(getSourceViewer(), required);
if (adapter != null)
return adapter;
}

return super.getAdapter(required);
}

protected void initializeEditor() {
super.initializeEditor();
setSourceViewerConfiguration(new MySourceViewerConfiguration(this));
reconcilingStrategy = new MyReconcilingStrategy(this);
}

protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
fAnnotationAccess= createAnnotationAccess();
fOverviewRuler= createOverviewRuler(getSharedColors());
ISourceViewer viewer= new ProjectionViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles);
getSourceViewerDecorationSupport(viewer).updateOverviewDecor ations();
return viewer;
}

@Override
protected IOverviewRuler getOverviewRuler() {
// TODO Auto-generated method stub
return super.getOverviewRuler();
}

public void createPartControl(Composite parent) {

super.createPartControl(parent);
if (fMatchingCharacterPainter == null) {
if (getSourceViewer() instanceof ISourceViewerExtension2) {
fMatchingCharacterPainter = new MatchingCharacterPainter(getSourceViewer(), fPairMatcher);
Display display = Display.getCurrent();
fMatchingCharacterPainter.setColor(new Color(display, MyColorProvider.STRING));
ITextViewerExtension2 extension = (ITextViewerExtension2) getSourceViewer();
extension.addPainter(fMatchingCharacterPainter);
}
}
}

protected void adjustHighlightRange(int offset, int length) {
ISourceViewer viewer= getSourceViewer();
if (viewer instanceof ITextViewerExtension5) {
ITextViewerExtension5 extension= (ITextViewerExtension5) viewer;
extension.exposeModelRange(new Region(offset, length));
}
}

public void updateOutlinePage() {
if (fOutlinePage == null)
fOutlinePage = (MyContentOutlinePage) getAdapter(IContentOutlinePage.class);
fOutlinePage.setInput(getEditorInput());
OutlineContentProvider contentProvider = (OutlineContentProvider) fOutlinePage.getContentProvider();
if (fOutlinePage.getControl() == null) {
contentProvider.inputChanged(null, null, getEditorInput());
}
}

public MyReconcilingStrategy getReconcilingStrategy() {
return reconcilingStrategy;
}
}


Next, we would like show you the problem.
Here we have a personal project/class of our plugin:

http://img697.imageshack.us/i/verticalbar.jpg/

The marked bar is where we have the problem.
If we resize or we try to put a toggle breakpoint, it is not painted but programatically it is detected and found.

Here we show you what happen when we resize. Graphic garbage is into the bar:

http://img198.imageshack.us/i/errorsp.jpg/

Maybe someone can help us to find where is the problem.

Thank you very much.
Previous Topic:Problem with IVerticalRuler - org.eclipse.ui.editors
Next Topic:Standard overlay icons for warning/error
Goto Forum:
  


Current Time: Thu Apr 25 11:54:35 GMT 2024

Powered by FUDForum. Page generated in 0.03772 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top