eclipse中源代码编辑器

来源:互联网 发布:新闻类网站数据库设计 编辑:程序博客网 时间:2024/05/18 22:14

 

public void createPartControl(Composite parent) {
   // TODO 自动生成方法存根
// Composite comp = new Composite(parent,SWT.NONE);
//   comp.setLayout(new FillLayout());
//   Text text = new Text(comp,SWT.BORDER);
//  
//   text.setText("啦啦啦");
//   parent.setLayout(new FillLayout());
//
//   SourceViewer ourceViewer = new SourceViewer(parent,null, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION) ;

  
   CompositeRuler ruler = new CompositeRuler();
       
   SourceViewer sv =new SourceViewer(parent,ruler,SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL );
         
   LineNumberRulerColumn lineCol = new LineNumberRulerColumn();
         
   ruler.addDecorator(0, lineCol);
         
   Document doc = new Document("slkjfids/njsofjei/nlsjfdd/n");    
             
   sv.setDocument(doc);
}

原创粉丝点击