当前位置: 首页>>代码示例>>Java>>正文


Java SWT.SEARCH属性代码示例

本文整理汇总了Java中org.eclipse.swt.SWT.SEARCH属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.SEARCH属性的具体用法?Java SWT.SEARCH怎么用?Java SWT.SEARCH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.swt.SWT的用法示例。


在下文中一共展示了SWT.SEARCH属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createDialogArea

@Override
protected Control createDialogArea(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(new GridLayout(2, true));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    Composite searchComposite = new Composite(container, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    searchComposite.setLayout(layout);
    searchComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));

    Label txtFilter = new Label(searchComposite, SWT.NONE);
    txtFilter.setText(Messages.CodeFilter_search_by_code);
    txtFilter.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));

    text = new Text(searchComposite, SWT.BORDER | SWT.SEARCH | SWT.ICON_SEARCH | SWT.ICON_CANCEL);
    text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    text.setText(filter.getPattern());

    btnRegEx = new Button(searchComposite, SWT.CHECK);
    btnRegEx.setText(Messages.diffTableViewer_use_regular_expressions);
    btnRegEx.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
    btnRegEx.setSelection(filter.isUseRegex());

    new Label(container, SWT.NONE).setText(Messages.FilterDialog_show_object_types);

    new Label(container, SWT.NONE).setText(Messages.FilterDialog_show_change_types);

    objViewer = CheckboxTableViewer.newCheckList(container, SWT.BORDER);
    objViewer.add(new DbObjType[] {DbObjType.SCHEMA, DbObjType.EXTENSION, DbObjType.TYPE,
            DbObjType.DOMAIN, DbObjType.SEQUENCE, DbObjType.FUNCTION, DbObjType.TABLE,
            DbObjType.VIEW, DbObjType.CONSTRAINT, DbObjType.INDEX, DbObjType.TRIGGER,
            DbObjType.RULE});

    objViewer.setCheckedElements(types.toArray());
    objViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

    chgViewer = CheckboxTableViewer.newCheckList(container, SWT.BORDER);
    chgViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    chgViewer.setContentProvider(ArrayContentProvider.getInstance());
    chgViewer.setLabelProvider(new LabelProvider() {

        @Override
        public String getText(Object element) {
            switch (((DiffSide) element)) {
            case BOTH: return "edit"; //$NON-NLS-1$
            case LEFT: return "project"; //$NON-NLS-1$
            case RIGHT: return "remote"; //$NON-NLS-1$
            default: return null;
            }
        }
    });

    chgViewer.setInput(DiffSide.values());
    chgViewer.setCheckedElements(sides.toArray());

    return searchComposite;
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:60,代码来源:FilterDialog.java


注:本文中的org.eclipse.swt.SWT.SEARCH属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。