Eclipse3.3加入了很多很Cool的功能,下面一一介绍:
1、Viewer和Editor的最大化最小化效果变的很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;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
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;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
public
class
FieldDecorationDemo
...
{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
public void run()...{
Display display = new Display();
Shell shell = new Shell(display);
shell.setSize(200, 200);
shell.setText("Button Example");
shell.setLayout(new GridLayout());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
createFieldDecoration(shell);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
shell.open();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
while (!shell.isDisposed())...{
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
private void createFieldDecoration(Shell shell)...{
createCombo(shell);
createButton(shell);
createText(shell);
createList(shell);
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
private void createText(Shell shell)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
IControlCreator cbCtrl = new IControlCreator()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
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);
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
private void createButton(Shell shell)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
IControlCreator cbCtrl = new IControlCreator()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
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);
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
private void createCombo(Shell shell)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
IControlCreator cbCtrl = new IControlCreator()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
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);
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
private void createList(Shell shell)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
IControlCreator cbCtrl = new IControlCreator()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
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);
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
public static void main(String[] args)...{
new FieldDecorationDemo().run();
}
}
4、增强Porperties View的现实效果;
![](https://p-blog.csdn.net/images/p_blog_csdn_net/kevin99zhang/clip_image004.gif)
5、可控制的启动画面;
在Eclipse3.3中提供了新的扩展点
org.eclipse.osgi.service.runnable.StartupMonitor,用于在启动时使用SWT的代码。
6、高级的Tooltips:
提供了新的扩展点:org.eclipse.jface.window.Tooltip用于创建更为高级的Tooltips;
![](https://p-blog.csdn.net/images/p_blog_csdn_net/kevin99zhang/clip_image005.gif)
7、SWT增加时间日期选择器:
真想不通,时间和日期选择器早都应该提供了,为什么到现在才拿出来!
![](https://p-blog.csdn.net/images/p_blog_csdn_net/kevin99zhang/clip_image006.jpg)
![](https://p-blog.csdn.net/images/p_blog_csdn_net/kevin99zhang/clip_image007.jpg)
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、原来双击鼠标可以选中一个单词,现在三击鼠标可以选中一行
13、Ctrl+Alt+J 把下一行连接到这一行的后面
更多新特性,请参考Eclipse官方网站。