Eclipse3.3新特性

 

Eclipse3.3加入了很多很Cool的功能,下面一一介绍:

        1ViewerEditor的最大化最小化效果变的很Cool
       
此新特性,可能对开发人员来说并没有什么稀奇的,有这个和没有这个的区别不大。但是对于RCP的开发,这个是一个非常吸引客户眼球的地方。

对于开发人员来说,只需要这样就可以让一个Viewer在透视图启动时做最小化了,如果你用的是Eclipse3.3开发RCP程序,那么就可以非常方便的给客户在一个透视图中展现多个Viewer了。

代码如下:

public void createInitialLayout(IPageLayout layout)  {        

PageLayout pageLayout = (PageLayout)layout;        

//layout.addView(ViewPart1.class.getName(), IPageLayout.LEFT,  0.35f , 

layout.getEditorArea());       

pageLayout.addView(ViewPart1.class.getName(), IPageLayout.LEFT,  0.35f , 

layout.getEditorArea(), true);

}

2、当Editor最大化以后,其他的Viewer将以新的列表方式继续出现在界面上;
 
          3
、对Forms加入了错误信息验证:

 以前的版本中,Form是没有错误验证的,现在则加入了Forms的验证,看来Form的使用可以更快的深入人心了。

其实在以前的版本中,我们是可以自己通过代码来实现类似的功能:

package  com.zhangjun.test;

import  org.eclipse.jface.fieldassist.DecoratedField;
import  org.eclipse.jface.fieldassist.FieldDecoration;
import  org.eclipse.jface.fieldassist.FieldDecorationRegistry;
import  org.eclipse.jface.fieldassist.IControlCreator;
import  org.eclipse.swt.SWT;
import  org.eclipse.swt.layout.GridLayout;
import  org.eclipse.swt.widgets.Button;
import  org.eclipse.swt.widgets.Combo;
import  org.eclipse.swt.widgets.Composite;
import  org.eclipse.swt.widgets.Control;
import  org.eclipse.swt.widgets.Display;
import  org.eclipse.swt.widgets.List;
import  org.eclipse.swt.widgets.Shell;
import  org.eclipse.swt.widgets.Text;

public   class  FieldDecorationDemo {

    
public void run(){
        Display display 
= new Display();
        Shell shell 
= new Shell(display);
        shell.setSize(
200200);
        shell.setText(
"Button Example");
        shell.setLayout(
new GridLayout());

        createFieldDecoration(shell);

        shell.open();
        
while (!shell.isDisposed()){
            
if (!display.readAndDispatch())
                display.sleep();
        }

        display.dispose();
    }


    
private void createFieldDecoration(Shell shell){
        createCombo(shell);
        createButton(shell);
        createText(shell);
        createList(shell);
    }


    
private void createText(Shell shell){
        IControlCreator cbCtrl 
= new IControlCreator(){

            
public Control createControl(final Composite parent, final int style){
                Text text 
= new Text(parent, style);
                text.setText(
"text");
                
return text;
            }

        }
;
        DecoratedField dField 
= new DecoratedField(shell, SWT.BORDER, cbCtrl);
        FieldDecoration decoration 
= FieldDecorationRegistry.getDefault().getFieldDecoration(
                                                                 FieldDecorationRegistry.DEC_ERROR);
        dField.addFieldDecoration(decoration, SWT.RIGHT 
| SWT.TOP, false);
    }


    
private void createButton(Shell shell){
        IControlCreator cbCtrl 
= new IControlCreator(){

            
public Control createControl(final Composite parent, final int style){
                Button button 
= new Button(parent, style);
                button.setText(
"button");
                
return button;
            }

        }
;
        DecoratedField dField 
= new DecoratedField(shell, SWT.NONE, cbCtrl);
        FieldDecoration decoration 
= FieldDecorationRegistry.getDefault().getFieldDecoration(
                FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
        dField.addFieldDecoration(decoration, SWT.RIGHT 
| SWT.TOP, false);
    }


    
private void createCombo(Shell shell){
        IControlCreator cbCtrl 
= new IControlCreator(){

            
public Control createControl(final Composite parent, final int style){
                Combo cb 
= new Combo(parent, style);
                cb.setText(
"combo");
                
return cb;
            }

        }
;
        DecoratedField dField 
= new DecoratedField(shell, SWT.BORDER, cbCtrl);
        FieldDecoration decoration 
= FieldDecorationRegistry.getDefault()
                .getFieldDecoration(FieldDecorationRegistry.DEC_REQUIRED);
        dField.addFieldDecoration(decoration, SWT.RIGHT 
| SWT.TOP, false);
    }

    
    
private void createList(Shell shell){
        IControlCreator cbCtrl 
= new IControlCreator(){

            
public Control createControl(final Composite parent, final int style){
                List cb 
= new List(parent, style);
                
return cb;
            }

        }
;
        DecoratedField dField 
= new DecoratedField(shell, SWT.BORDER, cbCtrl);
        FieldDecoration decoration 
= FieldDecorationRegistry.getDefault()
                .getFieldDecoration(FieldDecorationRegistry.DEC_WARNING);
        dField.addFieldDecoration(decoration, SWT.RIGHT 
| SWT.TOP, false);
    }


    
public static void main(String[] args){
        
new FieldDecorationDemo().run();
    }

}

  4、增强Porperties View的现实效果;

          5
、可控制的启动画面;
         
Eclipse3.3中提供了新的扩展点
org.eclipse.osgi.service.runnable.StartupMonitor,用于在启动时使用SWT的代码。
    6
、高级的Tooltips

    提供了新的扩展点:org.eclipse.jface.window.Tooltip用于创建更为高级的Tooltips

    7
SWT增加时间日期选择器:

    真想不通,时间和日期选择器早都应该提供了,为什么到现在才拿出来!

         8
、新增加2种启动界面;
Interactive: A simulated log-in session  
使用一个程序登陆界面启动
Browser: An embedded HTML browser  
使用一个Html作为登陆界面
Extensible: A dynamic set of image contributions
使用一张图片作为启动界面
        
在新的PDE中可以对一个product选择使用那一种启动界面启动,这个新功能的增加是非常有意义的,它使得RCP应用更加的人性化,不用再在系统启动中弹出对话框了,让客户更加放心的选择基于RCP的产品了。

9、快速访问功能:如果你想使用哪个命令,只需要点Ctrl+3启动快速访问,在里面输入命令的前n个字母或者首字母缩写,就可以选择你要运行的命令了。
        10
、支持内容的拖拽,如把第一行的内容直接拖拽到第三行
        11
、按住Ctrl键不松手,使用鼠标滚轮可迅速到达内容的开头或结尾
        12
、原来双击鼠标可以选中一个单词,现在三击鼠标可以选中一行
        13Ctrl+Alt+J  把下一行连接到这一行的后面
       
更多新特性,请参考Eclipse官方网站。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值