當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。