工作记录5月9日开始(不断更新中)
2006-05-10 10:38
387 查看
2006年5月9日
讨论了关于gmf的一些feature
2006年5月14日
1.阅读文章“Learn how to implement the Command pattern in Java ”
http://www.javaworld.com/javaworld/javatips/jw-javatip68.html
该文章主要讲了设计基于java语言特性的Command框架设计。
figure 1 关于Receiver和Invoker交互关系的序列图
The key idea here is that the concrete command registers itself with the
the Command pattern completely decouples the object that invokes the operation from the ones having the knowledge to perform it. This gives us a lot of flexibility: the object issuing a request must know only how to issue it; it doesn't need to know how the request will be carried out.
2006年5月15日
在eclipse
newsgroup里面看到这样一个提问,也许对我们的项目有帮助:
How to call "Arrange all" during editor starts up?
When using ecore example editor to visualize ecore model,
the diagram does not look nice when editor is up. The connections pass through
the figures and very hard to read. Is there a way to invoke "Arrange
all" function programmatically when editor is starting ? Any help
will be greatly appreciated.
答曰:
Never mind. I found a way to do this by sending an
ArrangeRequest to diagram editpart in editor's initializeGraphicalViewer().
Hope this will help someone with similar question :)
Note:
虽然说的不是太清楚,但是总算觉得有法可依了!
2006年5月19日
console窗口类
org.eclipse.ui.console.MessageConsole
A console that displays messages. A message console may have one or more
streams connected to it (
streams is buffered and processed in a Job by the console's document
partitioner.
Clients may instantiate this class; not intended to be subclassed.
org.eclipse.ui.dialogs.ListDialog
A dialog that prompts for one element out of a list of elements. Uses
the elements and
to provide their labels.
实现:
1 ListDialog dialog = new ListDialog(shell);
2 dialog.setInput(status);
3 dialog.setTitle(title);
4 dialog.setContentProvider(new IStructuredContentProvider() {
5 public void dispose() {
6 // nothing to dispose
7 }
8
9 public Object[] getElements(Object inputElement) {
if (status != null && status.isMultiStatus() && status == inputElement) {
return status.getChildren();
} else if (status != null && status == inputElement) {
return new Object[] {status};
}
return new Object[0];
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
// Do nothing.
}
});
dialog.setLabelProvider(new LabelProvider() {
public String getText(Object element) {
if (element instanceof IStatus) {
return ((IStatus)element).getMessage();
}
return null;
}
});
dialog.setBlockOnOpen(true);
dialog.setMessage(ValidationMessages.BatchValidationDelegate_errorMessage);
if (ListDialog.OK == dialog.open()) {
Set errorSelections = new HashSet();
if (!status.isMultiStatus()) {
IConstraintStatus cstatus = (IConstraintStatus)status;
errorSelections.add(cstatus.getTarget());
} else {
IStatus[] children = status.getChildren();
for (int i = 0; i<children.length; i++) {
IConstraintStatus cstatus = (IConstraintStatus)children[i];
errorSelections.add(cstatus.getTarget());
}
}
editor.setSelectionToViewer(errorSelections);
}
讨论了关于gmf的一些feature
2006年5月14日
1.阅读文章“Learn how to implement the Command pattern in Java ”
http://www.javaworld.com/javaworld/javatips/jw-javatip68.html
该文章主要讲了设计基于java语言特性的Command框架设计。
figure 1 关于Receiver和Invoker交互关系的序列图
The key idea here is that the concrete command registers itself with the
Invokerand the
Invokercalls it back, executing the command on the
Receiver.
在eclipse
newsgroup里面看到这样一个提问,也许对我们的项目有帮助:
How to call "Arrange all" during editor starts up?
When using ecore example editor to visualize ecore model,
the diagram does not look nice when editor is up. The connections pass through
the figures and very hard to read. Is there a way to invoke "Arrange
all" function programmatically when editor is starting ? Any help
will be greatly appreciated.
答曰:
Never mind. I found a way to do this by sending an
ArrangeRequest to diagram editpart in editor's initializeGraphicalViewer().
Hope this will help someone with similar question :)
Note:
虽然说的不是太清楚,但是总算觉得有法可依了!
2006年5月19日
console窗口类
org.eclipse.ui.console.MessageConsole
A console that displays messages. A message console may have one or more
streams connected to it (
MessageConsoleStream). Text written to
streams is buffered and processed in a Job by the console's document
partitioner.
Clients may instantiate this class; not intended to be subclassed.
org.eclipse.ui.dialogs.ListDialog
A dialog that prompts for one element out of a list of elements. Uses
IStructuredContentProviderto provide
the elements and
ILabelProvider
to provide their labels.
实现:
1 ListDialog dialog = new ListDialog(shell);
2 dialog.setInput(status);
3 dialog.setTitle(title);
4 dialog.setContentProvider(new IStructuredContentProvider() {
5 public void dispose() {
6 // nothing to dispose
7 }
8
9 public Object[] getElements(Object inputElement) {
if (status != null && status.isMultiStatus() && status == inputElement) {
return status.getChildren();
} else if (status != null && status == inputElement) {
return new Object[] {status};
}
return new Object[0];
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
// Do nothing.
}
});
dialog.setLabelProvider(new LabelProvider() {
public String getText(Object element) {
if (element instanceof IStatus) {
return ((IStatus)element).getMessage();
}
return null;
}
});
dialog.setBlockOnOpen(true);
dialog.setMessage(ValidationMessages.BatchValidationDelegate_errorMessage);
if (ListDialog.OK == dialog.open()) {
Set errorSelections = new HashSet();
if (!status.isMultiStatus()) {
IConstraintStatus cstatus = (IConstraintStatus)status;
errorSelections.add(cstatus.getTarget());
} else {
IStatus[] children = status.getChildren();
for (int i = 0; i<children.length; i++) {
IConstraintStatus cstatus = (IConstraintStatus)children[i];
errorSelections.add(cstatus.getTarget());
}
}
editor.setSelectionToViewer(errorSelections);
}
相关文章推荐
- 工作中记录的命令和知识点(不断更新)
- matlab小问题记录(不断更新)
- sharepoint个人操作记录(个人备忘,不断更新)
- awk工作中常用命令介绍---不断更新中
- 开始记录工作中遇到的一些技术问题
- 【Linux--工作记录】工作中遇到的问题总结--更新中
- 工作中遇到的svn 命令总结----不断更新
- 继续奋斗,开始记录MTK培训历程 分类: 工作生活经历 2009-02-25 23:29 248人阅读 评论(1) 收藏
- 一些好的学习型网站记录(不断更新)
- 开始自己的blog之旅,记录一下自己的工作中的一点感受
- CSDN IOS不错的博客记录(不断更新)
- 开始工作,博客恢复更新
- 开始稍微系统点的联系,难度不断增加,持续更新
- 个人POJ解题记录【不断更新】
- mongodb常用基本命令(根据工作需要,不断更新)
- 工作中遇到的hql语句,不断更新中
- String从0开始 【不断更新】
- 该帖子会记录一些工作中用到的小方法..会时常更新...
- 【无私分享:从入门到精通ASP.NET MVC】从0开始,一起搭框架、做项目(6) 控制器基类 主要做登录用户、权限认证、日志记录等工作
- 2017年1月22日,我打算开始记录自己接下来的学习、生活、工作历程。