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


Java ComboViewer.addPostSelectionChangedListener方法代码示例

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


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

示例1: createRuntimeField

import org.eclipse.jface.viewers.ComboViewer; //导入方法依赖的package包/类
@Override
protected void createRuntimeField(Composite composite) {
  Label runtimeLabel = new Label(composite, SWT.LEAD);
  runtimeLabel.setText(Messages.getString("app.engine.standard.project.runtimetype")); //$NON-NLS-1$
  runtimeField = new ComboViewer(composite, SWT.READ_ONLY);
  runtimeField.setLabelProvider(new LabelProvider() {
    @Override
    public String getText(Object element) {
      return ((AppEngineRuntime) element).getLabel();
    }
  });
  runtimeField.setContentProvider(ArrayContentProvider.getInstance());
  runtimeField.setInput(AppEngineRuntime.STANDARD_RUNTIMES);
  runtimeField.setSelection(new StructuredSelection(DEFAULT_RUNTIME), true);
  runtimeField.addPostSelectionChangedListener(new ISelectionChangedListener() {
    @Override
    public void selectionChanged(SelectionChangedEvent event) {
      revalidate();
    }
  });
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:22,代码来源:AppEngineStandardWizardPage.java

示例2: CompilerBlock

import org.eclipse.jface.viewers.ComboViewer; //导入方法依赖的package包/类
public CompilerBlock(Composite root, int style) {
  super(root, style);

  setLayout(new FillLayout(SWT.HORIZONTAL));

  Composite parent = new Composite(this, SWT.NONE);
  parent.setLayout(new GridLayout(1, false));

  groupDevMode = SWTFactory.createGroup(parent, GROUP_COMPILER_TITLE, 2, 1, GridData.FILL_HORIZONTAL);

  // Log level
  Label label = SWTFactory.createLabel(groupDevMode, "Log level:", 1);
  GridData gd_label = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
  gd_label.widthHint = 101;
  label.setLayoutData(gd_label);
  logLevelComboViewer = new ComboViewer(groupDevMode, SWT.READ_ONLY);
  new Label(groupDevMode, SWT.NONE);
  logLevelComboViewer.setContentProvider(new ArrayContentProvider());
  logLevelComboViewer.setLabelProvider(new DefaultComboLabelProvider());
  logLevelComboViewer.setInput(LogLevelArgumentProcessor.LOG_LEVELS);
  logLevelComboViewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
    @Override
    public void selectionChanged(SelectionChangedEvent event) {
      updateLaunchConfigHandler.updateLaunchConfig();
    }
  });
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:28,代码来源:CompilerBlock.java

示例3: createControl

import org.eclipse.jface.viewers.ComboViewer; //导入方法依赖的package包/类
@Override
public void createControl(final Composite parent) {
	super.createControl(parent); // We need to create the UI controls from the parent class.

	final Composite control = (Composite) getControl();
	control.setLayout(GridLayoutFactory.fillDefaults().create());
	control.setLayoutData(fillDefaults().align(FILL, FILL).grab(true, true).create());

	final DataBindingContext dbc = new DataBindingContext();
	control.addDisposeListener(e -> dbc.dispose());

	createVendorIdControls(dbc, control);

	ComboViewer projectTypeCombo = new ComboViewer(control, READ_ONLY);
	projectTypeCombo.setLabelProvider(new ProjectTypeLabelProvider());
	projectTypeCombo.setContentProvider(ArrayContentProvider.getInstance());
	projectTypeCombo.getControl().setLayoutData(fillDefaults().grab(true, false).create());
	projectTypeCombo.setInput(ProjectType.values());

	Composite projectTypePropertyControls = new Composite(control, NONE);
	StackLayout changingStackLayout = new StackLayout();
	projectTypePropertyControls.setLayout(changingStackLayout);
	projectTypePropertyControls.setLayoutData(fillDefaults().align(FILL, FILL).grab(true, true).create());

	Composite defaultOptions = initDefaultOptionsUI(dbc, projectTypePropertyControls);
	Composite libraryProjectOptionsGroup = initLibraryOptionsUI(dbc, projectTypePropertyControls);
	Composite testProjectOptionsGroup = initTestProjectUI(dbc, projectTypePropertyControls);

	initProjectTypeBinding(dbc, projectTypeCombo);

	// Configure stack layout to show advanced options
	projectTypeCombo.addPostSelectionChangedListener(e -> {
		switch (projectInfo.getProjectType()) {
		case LIBRARY:
			changingStackLayout.topControl = libraryProjectOptionsGroup;
			break;
		case TEST:
			changingStackLayout.topControl = testProjectOptionsGroup;
			break;
		default:
			changingStackLayout.topControl = defaultOptions;
		}
		projectTypePropertyControls.layout(true);
		setPageComplete(validatePage());
	});

	// IDs from: org.eclipse.jdt.internal.ui.workingsets.IWorkingSetIDs.class
	createWorkingSetGroup(
			(Composite) getControl(),
			null,
			new String[] { "org.eclipse.ui.resourceWorkingSetPage",
					"org.eclipse.jdt.ui.JavaWorkingSetPage",
					"org.eclipse.jdt.internal.ui.OthersWorkingSet"
			}); // $NON-NLS-1$
	Dialog.applyDialogFont(getControl());

	dbc.updateTargets();

	setControl(control);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:61,代码来源:N4MFWizardNewProjectCreationPage.java

示例4: createDialogArea

import org.eclipse.jface.viewers.ComboViewer; //导入方法依赖的package包/类
/**
 * 
 * {@inheritDoc}
 * 
 * @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
 */
@Override
protected Control createDialogArea(Composite parent) {
	setTitleImage(ResourceManager.getPluginImage(
		"org.eclipse.emf.emfstore.client.ui", "icons/login_icon.png"));
	setTitle("Log in to " + controller.getServer().getName());
	setMessage("Please enter your username and password");
	getShell().setText("Authentication required");
	final Composite area = (Composite) super.createDialogArea(parent);
	final Composite container = new Composite(area, SWT.NONE);
	container.setLayout(new GridLayout(1, false));
	container.setLayoutData(new GridData(GridData.FILL_BOTH));

	final Composite loginContainer = new Composite(container, SWT.NONE);
	loginContainer.setLayout(new GridLayout(3, false));
	loginContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
		true, 1, 1));
	loginContainer.setBounds(0, 0, 64, 64);

	final Label usernameLabel = new Label(loginContainer, SWT.NONE);
	GridData gridData = new GridData(SWT.RIGHT, SWT.CENTER, false, false,
		1, 1);
	gridData.widthHint = 95;
	usernameLabel.setLayoutData(gridData);
	usernameLabel.setText("Username");

	usernameCombo = new ComboViewer(loginContainer, SWT.NONE);
	final ComboListener comboListener = new ComboListener();
	usernameCombo.addPostSelectionChangedListener(comboListener);
	final Combo combo = usernameCombo.getCombo();
	combo.addModifyListener(comboListener);
	gridData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
	gridData.widthHint = 235;
	combo.setLayoutData(gridData);
	new Label(loginContainer, SWT.NONE);

	final Label passwordLabel = new Label(loginContainer, SWT.NONE);
	gridData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
	gridData.widthHint = 80;
	passwordLabel.setLayoutData(gridData);
	passwordLabel.setText("Password");

	passwordField = new Text(loginContainer, SWT.BORDER | SWT.PASSWORD);
	gridData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
	gridData.widthHint = 250;
	passwordField.setLayoutData(gridData);
	passwordField.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent e) {
			passwordModified = true;
			flushErrorMessage();
		}
	});
	new Label(loginContainer, SWT.NONE);

	final Label savePasswordLabel = new Label(loginContainer, SWT.NONE);
	savePasswordLabel.setText("Save Password");

	savePassword = new Button(loginContainer, SWT.CHECK);
	new Label(loginContainer, SWT.NONE);

	initData();
	if (controller.getUsersession() == null) {
		final ESUsersession lastUsersession = controller.getServer().getLastUsersession();
		if (lastUsersession != null) {
			loadUsersession(((ESUsersessionImpl) lastUsersession).toInternalAPI());
		} else {
			loadUsersession(null);
		}
	} else {
		final ESUsersession usersession = controller.getUsersession();
		loadUsersession(((ESUsersessionImpl) usersession).toInternalAPI());
	}
	return area;
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:80,代码来源:LoginDialog.java


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