views:

10

answers:

0

Hi,

I am a developer of Elipse's plugins, I created an Editor containing a TextViewer I wanted to disable the standard selection of text so I created a class that inherits SyledText in a package "org.eclipse.swt.custom", then I override the method doMouseSelection () the problem is when I put this package in a fragment (plugin-host = org.eclipse.swt) it works correctly but when I put it in my plugin, the selection is active, why?

public class MyStyledText extends StyledText {

public MyStyledText(Composite parent, int style) {
    super(parent, style);
}

@Override
void doMouseSelection() {}
}

public class MyTextViewer extends TextViewer{

public MyTextViewer(Composite parent, int styles)
{
    super(parent, styles);
}

@Override
protected StyledText createTextWidget(Composite parent, int styles) {
    return new MyStyledText(parent, styles);
}
}

public class MyEditor extends EditorPart 
{
     public void createPartControl(Composite parent) {
MyTextViewer textViewer = new MyTextViewer(composite, SWT.V_SCROLL | SWT.H_SCROLL);
    }

}