读书人

Swt 总结(二)

发布时间: 2012-12-19 14:13:14 作者: rapoo

Swt 小结(二)

Dialog(Shell parent, int style)

style的风格如下
SWT.APPLICATION_MODAL : 阻塞应用程序中的其他窗口的输入.
?
SWT.PRIMARY_MODAL : 阻止父类窗口的输入, 其他的窗口不阻塞
?
SWT.SYSTEM_MODAL : 阻止所有的应用程序, 知道dialog处理完毕.
?
SWT.NONE : Modeless (the default).


ApplicationWindow

// 传入一个指定的parentShell
public ApplicationWindow(Shell parentShell)

IStatusts

IStatus Severity Codes

IStatus.CANCEL : Indicates that this status represents a cancellation
IStatus.ERROR : Indicates that this status represents an error
IStatus.INFO : Indicates that this status represents information
IStatus.OK : Indicates that this status represents an OK state
IStatus.WARNING : Indicates that this status represents a warning


public Status(int severity, String pluginId, int code, String message, Throwable exception)

// 注意 多个status时候, 他的severity为 最大的那个
public MultiStatus(String pluginId, int code, IStatus[] newChildren, String message, Throwable exception)


Action (就是抽象的一个动作, 点击menu, toolbar, 快捷键都触发同样的事情


Menu, MenuItem

Menu Styles Style? Description
SWT.BAR : 主菜单栏
?
SWT.DROP_DOWN : 在一个菜单下弹出下拉菜单 public Menu(Menu parentMenu): 默认设置为下拉菜单
?
SWT.POP_UP : 创建弹出菜单 Menu(Control parent) : 默认将菜单设置为parent的弹出菜单。
?
SWT.NO_RADIO_GROUP : 创建菜单, 但是不支持 单选按钮组.


MenuItem Styles Style Description
?
SWT.CHECK : Creates a menu item that can be toggled on and off.
?
SWT.CASCADE : 代表这个menu Item 还有子菜单条目.
?
SWT.PUSH : 菜单条目可以被点击.
?
SWT.RADIO : Creates one item within a group that can be toggled on and off.
?
SWT.SEPARATOR : Creates a separator item.


IPreferenceStore : 存储配置文件的值.

// 向prestore增加监听器, 监听prestore的变化
// 当prestore.setValue(key, value) 时候, 会触发监听器.
preStore.addPropertyChangeListener(this);


ModalContext : 用于长时间的操作, 在单独的线程中执行.

ImageDescriptor : 用于创建图片
JFaceResources:
ColorRegistry: put(String symbolicName, RGB colorData) : 会触发监听器的变化.
FontRegistry:
ImagaeRegistry:

Geometry: 提供了一系列的几何学函数.

ListenerList : 管理一系列监听器

StringConverter : 一系列 的 int/long/float <-> string 的转换
??? removeWhiteSpaces(String value) : 移除 String 的 所有空格

?

?

?

?

?

?

读书人网 >编程

热点推荐