Posts

Showing posts with the label partition

Eclipse Editor: Partially editable/read-only editor Part 1

Image
Restricting any keyboard input  in read-only section Eclipse plug-in development framework provides a robust editor feature. Given default implementation take care of each and every single requirements of a source editor like color coding, keyword highlighting, content assist , partitions and many more. 9Go through the another series of editor development on my blog for more details about building editor.) Eclipse Editor: Partially editable/read-only editor Series Part 1: Restricting any keyboard input in read-only section Part 2: Decorating read-only section by line background. Part 3: Blocking Editor Actions in read-only code section . Part 4: Blocking drag & drop action to non-editable section Many time we have very strange requirements which standard eclipse framework doesn’t support or there is no straight forward way to achieve it. Many times source files are auto generated by some designing tools and such file can only be editable in the designing tool ...

Eclipse PDE: Everything about Editor Part 2

Document Partition In this series of “ Eclipse PDE: Everything about Editor ”, this post explains how to configure your document to represent different partition. Document partitions helps to manipulate different part of document in different way. For example there is not need to showing content assist in single line comment or multi line comment. Here I am explaining defining partition for single and multi line comments 1. Define a custom partition scanner Eclipse framework provides Rule based partition scanner, which allows us to define single or multi line rule for partitioning document content. We need to define Custome partition scanner extending org.eclipse.jface.text.rules.RuleBasedPartitionScanner . Override the constructor and define rules for partition . Below code snippets defines rule for single and multi line comments public class MyPartitionScanner extends RuleBasedPartitionScanner { //Define COnstants for supported partition types public static ...