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