putypuruty / veloeclipse

Automatically exported from code.google.com/p/veloeclipse
Other
0 stars 0 forks source link

Drag and drop vm file from outside project doesn't work #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Dragging and dropping a vm file from outside the project creates a screen with 
a blue line, and the 
text "ERROR" below it. Also, the status line contains '?' for column and line 
number.

Original issue reported on code.google.com by byron.foster@gmail.com on 31 Mar 2009 at 2:34

GoogleCodeExporter commented 9 years ago
look here for a solution:
http://stackoverflow.com/questions/455210/eclipse-editor-plugin-error-when-openi
ng-file-outside-project

Original comment by a.wo...@gmail.com on 10 Aug 2009 at 5:40

GoogleCodeExporter commented 9 years ago
even simpler, I guess (untested) replacing your VelocityDocumentProvider class 
with
the following code fragment would solve this issue:

public class VelocityDocumentProvider extends TextFileDocumentProvider
{
    @Override
    public void connect(Object element) throws CoreException {
        super.connect(element);
        IDocument document = getDocument(element);
        if (document != null) {
            if (document.getDocumentPartitioner() == null) {
                IDocumentPartitioner partitioner = new FastPartitioner(new
VelocityPartitionScanner(), VelocityPartitionScanner.TYPES);
                partitioner.connect(document);
                document.setDocumentPartitioner(partitioner);
            }
        }
    }
}

Original comment by a.wo...@gmail.com on 10 Aug 2009 at 7:38