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


Java SWT.DROP_DOWN属性代码示例

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


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

示例1: createStandardCombo

public void createStandardCombo ( final Composite parent, final String attributeName, final String label, final String[] items, final IObservableMap data, final Object valueType )
{
    this.toolkit.createLabel ( parent, label + ":" );

    final Combo combo = new Combo ( parent, SWT.DROP_DOWN );

    combo.setItems ( items );
    this.toolkit.adapt ( combo );

    final GridData gd = new GridData ( GridData.FILL, GridData.BEGINNING, true, true );
    gd.horizontalSpan = 2;
    combo.setLayoutData ( gd );

    final IObservableValue value = Observables.observeMapEntry ( data, attributeName, valueType );
    this.dbc.bindValue ( WidgetProperties.text ().observe ( combo ), value );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:ConfigurationFormToolkit.java

示例2: createControl

@Override
public void createControl(Composite parent) {
    Composite area = new Composite(parent, SWT.NONE);
    area.setLayout(new GridLayout(2, false));
    area.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    new Label(area, SWT.NONE).setText(Messages.PgObject_project_name);
    viewerProject = new ComboViewer(area, SWT.READ_ONLY | SWT.DROP_DOWN);

    new Label(area, SWT.NONE).setText(Messages.PgObject_object_type);
    viewerType = new ComboViewer(area, SWT.READ_ONLY | SWT.DROP_DOWN);

    new Label(area, SWT.NONE).setText(Messages.PgObject_object_name);
    final Text txtName = new Text(area, SWT.BORDER);
    txtName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    txtName.addModifyListener(e -> {
        name = txtName.getText();
        getWizard().getContainer().updateButtons();
    });
    fillProjects();
    fillTypes();
    setControl(area);
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:23,代码来源:NewObjectWizard.java

示例3: createApplicationFilterView

private void createApplicationFilterView(GridData comboLayoutData, GridData textLayoutData) {
    Label label = new Label(group, SWT.NONE);
    label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
    label.setText(resourceBundle.getString("application"));

    applicationFilterCombo = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY);
    applicationFilterCombo.setLayoutData(comboLayoutData);
    fillCombo(applicationFilterCombo, FilterValueType.STRING);
    applicationFilterCombo.select(0);
    applicationFilterCombo.addModifyListener(e -> {
        FilterCondition condition = FilterCondition.getFilterConditionFromConditionText(applicationFilterCombo.getText());
        listeners.forEach(listener -> listener.processesFiltersViewApplicationFilterConditionChanged(this, condition));
    });

    applicationFilterText = new Text(group, SWT.NONE);
    applicationFilterText.setLayoutData(textLayoutData);
    applicationFilterText.addModifyListener(e -> {
        String text = applicationFilterText.getText();
        final String result = text.isEmpty() ? null : text;
        listeners.forEach(listener -> listener.processesFiltersViewApplicationFilterValueChanged(this, result));
    });
}
 
开发者ID:technology16,项目名称:pgsqlblocks,代码行数:22,代码来源:DBProcessesFiltersView.java

示例4: createClientFilterView

private void createClientFilterView(GridData comboLayoutData, GridData textLayoutData) {
    Label label = new Label(group, SWT.NONE);
    label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
    label.setText(resourceBundle.getString("client"));

    clientFilterCombo = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY);
    clientFilterCombo.setLayoutData(comboLayoutData);
    fillCombo(clientFilterCombo, FilterValueType.STRING);
    clientFilterCombo.select(0);
    clientFilterCombo.addModifyListener(e -> {
        FilterCondition condition = FilterCondition.getFilterConditionFromConditionText(clientFilterCombo.getText());
        listeners.forEach(listener -> listener.processesFiltersViewClientFilterConditionChanged(this, condition));
    });

    clientFilterText = new Text(group, SWT.NONE);
    clientFilterText.setLayoutData(textLayoutData);
    clientFilterText.addModifyListener(e -> {
        String text = clientFilterText.getText();
        final String result = text.isEmpty() ? null : text;
        listeners.forEach(listener -> listener.processesFiltersViewClientFilterValueChanged(this, result));
    });
}
 
开发者ID:technology16,项目名称:pgsqlblocks,代码行数:22,代码来源:DBProcessesFiltersView.java

示例5: addVersionSection

private void addVersionSection(Composite parent) {
	Composite composite = createDefaultComposite(parent);

	// Label for owner field
	Label ownerLabel = new Label(composite, SWT.NONE);
	ownerLabel.setText(LEGACY_VERSION_TITLE);

	// Owner text field
	legacyVersionCombo = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
	GridData gd = new GridData();
	gd.widthHint = convertWidthInCharsToPixels(COMBO_FIELD_WIDTH);
	legacyVersionCombo.setLayoutData(gd);

	// Populate owner text field
	LegacyVersion legacyVersion = LegacyManager.getInstance().getVersion(getProject());
	legacyVersionCombo.setItems(LegacyVersion.names());
	legacyVersionCombo.setText(legacyVersion.name());
}
 
开发者ID:sebez,项目名称:vertigo-chroma-kspplugin,代码行数:18,代码来源:VertigoPropertyPage.java

示例6: createUploadLimitMenu

/**
 * Creates the global upload limit context menu item
 * @param parent The system tray contextual menu
 */
private final void createUploadLimitMenu(final Menu parent) {
	if ( gm == null ){
		return;
	}
	final MenuItem uploadSpeedItem = new MenuItem(parent, SWT.CASCADE);
	uploadSpeedItem.setText(MessageText.getString("GeneralView.label.maxuploadspeed"));

	final Menu uploadSpeedMenu = new Menu(uiFunctions.getMainShell(),
			SWT.DROP_DOWN);

	uploadSpeedMenu.addListener(SWT.Show, new Listener() {
		@Override
		public void handleEvent(Event event) {
			SelectableSpeedMenu.generateMenuItems(uploadSpeedMenu, core, gm, true);
		}
	});

	uploadSpeedItem.setMenu(uploadSpeedMenu);
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:23,代码来源:SystemTraySWT.java

示例7: createDownloadLimitMenu

/**
 * Creates the global download limit context menu item
 * @param parent The system tray contextual menu
 */
private final void createDownloadLimitMenu(final Menu parent) {
	if ( gm == null ){
		return;
	}
	final MenuItem downloadSpeedItem = new MenuItem(parent, SWT.CASCADE);
	downloadSpeedItem.setText(MessageText.getString("GeneralView.label.maxdownloadspeed"));

	final Menu downloadSpeedMenu = new Menu(uiFunctions.getMainShell(),
			SWT.DROP_DOWN);

	downloadSpeedMenu.addListener(SWT.Show, new Listener() {
		@Override
		public void handleEvent(Event event) {
			SelectableSpeedMenu.generateMenuItems(downloadSpeedMenu, core, gm, false);
		}
	});

	downloadSpeedItem.setMenu(downloadSpeedMenu);
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:23,代码来源:SystemTraySWT.java

示例8: createQueryFilterView

private void createQueryFilterView(GridData comboLayoutData, GridData textLayoutData) {
    Label label = new Label(group, SWT.NONE);
    label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
    label.setText(resourceBundle.getString("query"));

    queryFilterCombo = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY);
    queryFilterCombo.setLayoutData(comboLayoutData);
    fillCombo(queryFilterCombo, FilterValueType.STRING);
    queryFilterCombo.select(0);
    queryFilterCombo.addModifyListener(e -> {
        FilterCondition condition = FilterCondition.getFilterConditionFromConditionText(queryFilterCombo.getText());
        listeners.forEach(listener -> listener.processesFiltersViewQueryFilterConditionChanged(this, condition));
    });

    queryFilterText = new Text(group, SWT.NONE);
    queryFilterText.setLayoutData(textLayoutData);
    queryFilterText.addModifyListener(e -> {
        String text = queryFilterText.getText();
        final String result = text.isEmpty() ? null : text;
        listeners.forEach(listener -> listener.processesFiltersViewQueryFilterValueChanged(this, result));
    });
}
 
开发者ID:technology16,项目名称:pgsqlblocks,代码行数:22,代码来源:DBProcessesFiltersView.java

示例9: createUserNameFilterView

private void createUserNameFilterView(GridData comboLayoutData, GridData textLayoutData) {
    Label label = new Label(group, SWT.NONE);
    label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
    label.setText(resourceBundle.getString("user_name"));

    userNameFilterCombo = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY);
    userNameFilterCombo.setLayoutData(comboLayoutData);
    fillCombo(userNameFilterCombo, FilterValueType.STRING);
    userNameFilterCombo.select(0);
    userNameFilterCombo.addModifyListener(e -> {
        FilterCondition condition = FilterCondition.getFilterConditionFromConditionText(userNameFilterCombo.getText());
        listeners.forEach(listener -> listener.processesFiltersViewUserNameFilterConditionChanged(this, condition));
    });

    userNameFilterText = new Text(group, SWT.NONE);
    userNameFilterText.setLayoutData(textLayoutData);
    userNameFilterText.addModifyListener(e -> {
        String text = userNameFilterText.getText();
        final String result = text.isEmpty() ? null : text;
        listeners.forEach(listener -> listener.processesFiltersViewUserNameFilterValueChanged(this, result));
    });
}
 
开发者ID:technology16,项目名称:pgsqlblocks,代码行数:22,代码来源:DBProcessesFiltersView.java

示例10: createApplicationMenu

private void createApplicationMenu() {
    Menu menuBar = new Menu(getShell(), SWT.BAR);
    MenuItem helpMenuHeader = new MenuItem(menuBar, SWT.CASCADE);
    helpMenuHeader.setText("&pgSqlBlocks");

    Menu helpMenu = new Menu(getShell(), SWT.DROP_DOWN);
    helpMenuHeader.setMenu(helpMenu);

    MenuItem helpGetHelpItem = new MenuItem(helpMenu, SWT.PUSH);
    helpGetHelpItem.setText(resourceBundle.getString("about"));
    helpGetHelpItem.addListener(SWT.Selection, e -> new AboutDlg(getShell()).open());
    getShell().setMenuBar(menuBar);

    MenuItem exitMenuItem = new MenuItem(helpMenu, SWT.PUSH);
    exitMenuItem.setText(resourceBundle.getString("exit"));
    exitMenuItem.addListener(SWT.Selection, e -> getShell().close());
    getShell().setMenuBar(menuBar);
}
 
开发者ID:technology16,项目名称:pgsqlblocks,代码行数:18,代码来源:ApplicationView.java

示例11: createTestContainerSelectionGroup

private void createTestContainerSelectionGroup (Composite parent) {
	Label fTestLabel = new Label(parent, SWT.NONE);
	GridData gd = new GridData( );
	gd.horizontalAlignment = SWT.RIGHT;
	gd.horizontalIndent = 25;
	gd.verticalAlignment=SWT.TOP;
	fTestLabel.setLayoutData(gd);
	fTestLabel.setText(MessageUtil.getString("mainTestExecutionContext"));
	 
	fMainTestExecutionComboViewer = new ComboViewer(parent,SWT.DROP_DOWN);
	Combo combo = fMainTestExecutionComboViewer.getCombo();
	combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	fMainTestExecutionComboViewer.setContentProvider(new   IStructuredContentProvider(){
		@Override
		public Object[] getElements(Object inputElement) {
			String projectName= (String) inputElement;
			loadMainExecutionContextTests(projectName);
			return mainExecutionContexts;
		}
	});
	ILabelProvider labelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_QUALIFIED);
	fMainTestExecutionComboViewer.setLabelProvider(labelProvider);
	fMainTestExecutionComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
        	 	fAdditionalTestViewer.setInput(null);
                IStructuredSelection selection = (IStructuredSelection) event.getSelection();
                if (selection.size() > 0){
                	  resetDoHint();
                      IType type =  (IType) selection.getFirstElement();
                      fAdditionalTestViewer.setInput(type);
                      validatePage();
                }
        }
	});
	combo.setData(GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4E_LAUNCH_TEST_CONFIGURATION_MAIN_TEST);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:37,代码来源:GW4ELaunchConfigurationTab.java

示例12: createControl

@Override
public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(new GridLayout(2, true));

    dbSource = new DbSourcePicker(container, Messages.DiffWizard_source, mainPrefs, this);
    dbSource.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    dbTarget = new DbSourcePicker(container, Messages.DiffWizard_target, mainPrefs, this);
    dbTarget.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Composite compTz = new Composite(container, SWT.NONE);
    GridLayout gl = new GridLayout(2, false);
    gl.marginWidth = gl.marginHeight = 0;
    compTz.setLayout(gl);

    new Label(compTz, SWT.NONE).setText(Messages.DiffWizard_db_tz);

    cmbTimezone = new ComboViewer(compTz, SWT.DROP_DOWN | SWT.BORDER);
    cmbTimezone.setContentProvider(ArrayContentProvider.getInstance());
    cmbTimezone.setLabelProvider(new LabelProvider());
    cmbTimezone.setInput(UIConsts.TIME_ZONES);
    cmbTimezone.getCombo().setText(ApgdiffConsts.UTC);

    if (proj != null) {
        dbTarget.setDbStore(new StructuredSelection(proj.getProject().getLocation().toFile()));
    }

    setControl(container);
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:30,代码来源:DiffWizard.java

示例13: createContents

@Override
protected Control createContents(Composite parent) {
    Composite panel = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    panel.setLayout(layout);

    btnForceUnixNewlines = new Button(panel, SWT.CHECK);
    btnForceUnixNewlines.setText(Messages.ProjectProperties_force_unix_newlines);
    btnForceUnixNewlines.setLayoutData(new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false, 2, 1));
    btnForceUnixNewlines.setSelection(prefs.getBoolean(PROJ_PREF.FORCE_UNIX_NEWLINES, true));

    Label label = new Label(panel, SWT.NONE);
    label.setText(Messages.projectProperties_timezone_for_all_db_connections);

    cmbTimezone = new Combo(panel, SWT.BORDER | SWT.DROP_DOWN);
    cmbTimezone.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    cmbTimezone.setItems(UIConsts.TIME_ZONES.toArray(new String[UIConsts.TIME_ZONES.size()]));
    String tz = prefs.get(PROJ_PREF.TIMEZONE, ApgdiffConsts.UTC);
    cmbTimezone.setText(tz);
    cmbTimezone.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            checkSwitchWarnLbl();
        }
    });

    lblWarn = new CLabel(panel, SWT.NONE);
    lblWarn.setImage(Activator.getEclipseImage(ISharedImages.IMG_OBJS_WARN_TSK));
    lblWarn.setText(Messages.ProjectProperties_change_projprefs_warn);
    GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, false, false, 2, 1);
    gd.exclude = true;
    lblWarn.setLayoutData(gd);
    lblWarn.setVisible(false);

    return panel;
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:39,代码来源:ProjectProperties.java

示例14: createParentControls

protected void createParentControls(Composite composite) {
	Label label = new Label(composite, SWT.WRAP);
       label.setText("Preference parent:");
       
       viewer = new ComboViewer(composite, SWT.DROP_DOWN);
       viewer.setContentProvider(new ArrayContentProvider());
       
       viewer.getControl().setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
               | GridData.HORIZONTAL_ALIGN_FILL));
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:10,代码来源:NewPreferenceDialog.java

示例15: createTopLevelMenuItem

public static MenuItem createTopLevelMenuItem(Menu menuParent,
		String localizationKey) {
	Menu menu = new Menu(Utils.findAnyShell(), SWT.DROP_DOWN);
	MenuItem menuItem = new MenuItem(menuParent, SWT.CASCADE);
	Messages.setLanguageText(menuItem, localizationKey);
	menuItem.setMenu(menu);

	/*
	 * A top level menu and its menu item has the same ID; this is used to locate them at runtime
	 */
	menu.setData(KEY_MENU_ID, localizationKey);
	menuItem.setData(KEY_MENU_ID, localizationKey);

	return menuItem;
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:15,代码来源:MenuFactory.java


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