Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
 package org.eclipse.equinox.internal.security.ui.wizard;
 
 import  org.eclipse.swt.SWT;
 import  org.eclipse.swt.layout.GridData;
 import  org.eclipse.swt.layout.GridLayout;
 import  org.eclipse.swt.widgets.*;
 
 public class CertificateImportTrustEngineSelectPage extends WizardPage implements Listener {
 
 	private Text aliasField;
 	private Combo trustEngineCombo;
 	private ArrayList trustEngines = new ArrayList();
 
 		super(pageName);
 	}
 
 	public void createControl(Composite parent) {
 		Composite certSelectComposite = new Composite(parent, SWT.NONE);
 		setControl(certSelectComposite);
 		GridLayout layout = new GridLayout();
 		layout.numColumns = 2;
 		layout.makeColumnsEqualWidth = false;
 		layout.marginWidth = 0;
 		certSelectComposite.setLayout(layout);
 		certSelectComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
 
 		Label aliasLabel = new Label(certSelectComposite, SWT.None);
 
 		 = new Text(certSelectComposite, SWT.None);
 		.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL));
 
 		/*
 		 *  create the trust engine area
 		 */
 		Label targetEngineLabel = new Label(certSelectComposite, SWT.None);
 		targetEngineLabel.setText(.);
 
 		 = new Combo(certSelectComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
 		TrustEngine[] availableEngines = Activator.getTrustEngines();
 
 		// get a list of trust engine and fill the combo
 		for (int i = 0; i < availableEngines.lengthi++) {
 			if (!availableEngines[i].isReadOnly()) {
 				.add(availableEngines[i]);
 				.add(availableEngines[i].getName());
 			}
 
 		}
 		if (.getItemCount() == 0)
 		else
 			.setVisibleItemCount(.size());
 
 	}
 
 	private void addListeners() {
 		.addListener(SWT.KeyUp, this);
 		.addListener(SWT.Selection, this);
 	}
 
 	public void handleEvent(Event e) {
 		if (e.widget == ) {
 			if (.getText().length() < 1) {
 			} else {
 			}
 		}
 
 		if (e.widget == ) {
 			if (.getSelectionIndex() == -1) {
 			} else {
 			}
 		}
	}
	public boolean canFlipToNextPage() {
		return (.getText().length() > 0) && (.getSelectionIndex() != -1);
	}
New to GrepCode? Check out our FAQ X