當前位置: 首頁>>代碼示例>>Java>>正文


Java Combo.addListener方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.Combo.addListener方法的典型用法代碼示例。如果您正苦於以下問題:Java Combo.addListener方法的具體用法?Java Combo.addListener怎麽用?Java Combo.addListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.Combo的用法示例。


在下文中一共展示了Combo.addListener方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: IntListParameter

import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
public IntListParameter(Composite composite, final String name,
	int defaultValue, final String labels[], final int values[]) {
super(name);
this.name = name;
this.values = values;

    if(labels.length != values.length)
      return;
    int value = COConfigurationManager.getIntParameter(name,defaultValue);
    int index = findIndex(value,values);
    list = new Combo(composite,SWT.SINGLE | SWT.READ_ONLY);
    for(int i = 0 ; i < labels.length  ;i++) {
      list.add(labels[i]);
    }

    setIndex(index);

    list.addListener(SWT.Selection, new Listener() {
         @Override
         public void handleEvent(Event e) {
        	 setIndex(list.getSelectionIndex());
         }
       });

  }
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:26,代碼來源:IntListParameter.java

示例2: createDestinationGroup

import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
/**
 * Create the export destination specification widgets
 */
protected void createDestinationGroup(Composite parent) {
	Font font = parent.getFont();
	// destination specification group
	Composite destinationSelectionGroup = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	destinationSelectionGroup.setLayout(layout);
	destinationSelectionGroup.setLayoutData(new GridData(
			GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
	destinationSelectionGroup.setFont(font);

	Label destinationLabel = new Label(destinationSelectionGroup, SWT.NONE);
	destinationLabel.setText(getTargetLabel());
	destinationLabel.setFont(font);

	// destination name entry field
	destinationNameField = new Combo(destinationSelectionGroup, SWT.SINGLE
			| SWT.BORDER);
	destinationNameField.addListener(SWT.Modify, this);
	destinationNameField.addListener(SWT.Selection, this);
	GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
			| GridData.GRAB_HORIZONTAL);
	data.widthHint = SIZING_TEXT_FIELD_WIDTH;
	destinationNameField.setLayoutData(data);
	destinationNameField.setFont(font);

	// destination browse button
	destinationBrowseButton = new Button(destinationSelectionGroup,
			SWT.PUSH);
	destinationBrowseButton.setText(N4ExportMessages.DataTransfer_browse);
	destinationBrowseButton.addListener(SWT.Selection, this);
	destinationBrowseButton.setFont(font);
	setButtonLayoutData(destinationBrowseButton);

	// new Label(parent, SWT.NONE); // vertical spacer
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:40,代碼來源:AbstractExportToSingleFileWizardPage.java

示例3: createOptionsGroupButtons

import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
@Override
protected void createOptionsGroupButtons(Group optionsGroup) {

	npmGoalSelection = new Combo(optionsGroup, SWT.SINGLE
			| SWT.BORDER);
	npmGoalSelection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	npmGoalSelection.addListener(SWT.Modify, this);
	npmGoalSelection.addListener(SWT.Selection, this);

}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:11,代碼來源:NpmToolRunnerPage.java

示例4: createDestinationGroup

import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
/**
 * Create the export destination specification widgets
 *
 * @param parent
 *            org.eclipse.swt.widgets.Composite
 */
@SuppressWarnings("unused")
@Override
protected void createDestinationGroup(Composite parent) {

	Font font = parent.getFont();
	// destination specification group
	Composite destinationSelectionGroup = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	destinationSelectionGroup.setLayout(layout);
	destinationSelectionGroup.setLayoutData(new GridData(
			GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
	destinationSelectionGroup.setFont(font);

	Label destinationLabel = new Label(destinationSelectionGroup, SWT.NONE);
	destinationLabel.setText("npm Target Folder");
	destinationLabel.setFont(font);

	// destination name entry field
	destinationNameField = new Combo(destinationSelectionGroup, SWT.SINGLE
			| SWT.BORDER);
	destinationNameField.addListener(SWT.Modify, this);
	destinationNameField.addListener(SWT.Selection, this);
	GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
			| GridData.GRAB_HORIZONTAL);
	data.widthHint = SIZING_TEXT_FIELD_WIDTH;
	destinationNameField.setLayoutData(data);
	destinationNameField.setFont(font);
	BidiUtils.applyBidiProcessing(destinationNameField, StructuredTextTypeHandlerFactory.FILE);

	// destination browse button
	destinationBrowseButton = new Button(destinationSelectionGroup,
			SWT.PUSH);
	destinationBrowseButton.setText(DataTransferMessages.DataTransfer_browse);
	destinationBrowseButton.addListener(SWT.Selection, this);
	destinationBrowseButton.setFont(font);
	setButtonLayoutData(destinationBrowseButton);

	new Label(parent, SWT.NONE); // vertical spacer
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:47,代碼來源:ExportSelectionPage.java

示例5: createControl

import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent) {
	composite = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	int nCols = 2;
	layout.numColumns = nCols;
	composite.setLayout(layout);
	composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
	GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
	gridData.widthHint = 250;
	
	//Project name
	projectNameLabel = new Label(composite, SWT.NONE);
	projectNameLabel.setText("Project name:");
	
	projectNameText = new Text(composite, SWT.BORDER | SWT.SINGLE);
	projectNameText.setLayoutData(gridData);
	projectNameText.addListener(SWT.Modify, this);
	projectNameText.setFocus();
	
	//Project infrastructure
	projectInfrastructureLabel = new Label(composite, SWT.NONE);
	projectInfrastructureLabel.setText("Infrastructure:");
	
	projectInfrastructureCombo = new Combo(composite, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
	projectInfrastructureCombo.add("Centralised");
	//projectInfrastructureCombo.add("Saci");
	projectInfrastructureCombo.add("Jade");
	projectInfrastructureCombo.add("JaCaMo");
	projectInfrastructureCombo.setText("Centralised");
	projectInfrastructureCombo.addListener(SWT.Modify, this);
	
	//Project environment
	projectEnvironmentLabel = new Label(composite, SWT.NONE);
	projectEnvironmentLabel.setText("Environment");
	
	projectEnvironmentCombo = new Combo(composite, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
	projectEnvironmentCombo.add("Without environment");
	projectEnvironmentCombo.add("CArtAgO");
	projectEnvironmentCombo.add("Jason");
	projectEnvironmentCombo.setText("Without environment");
	projectEnvironmentCombo.addListener(SWT.Modify, this);

	projectEnvironmentHostLabel = new Label(composite, SWT.NONE);
	projectEnvironmentHostLabel.setText("Environment host:");
	
	projectEnvironmentHostText = new Text(composite, SWT.BORDER | SWT.SINGLE);
	projectEnvironmentHostText.setLayoutData(gridData);
	projectEnvironmentHostText.setText("localhost");

	projectEnvironmentClassNameLabel = new Label(composite, SWT.NONE);
	projectEnvironmentClassNameLabel.setText("Environment class name:");
	
	projectEnvironmentClassNameText = new Text(composite, SWT.BORDER | SWT.SINGLE);
	projectEnvironmentClassNameText.setLayoutData(gridData);
	projectEnvironmentClassNameText.setText("");

	projectEnvironmentHostLabel.setVisible(false);
	projectEnvironmentHostText.setVisible(false);
	projectEnvironmentClassNameLabel.setVisible(false);
	projectEnvironmentClassNameText.setVisible(false);
	
	setControl(composite);
}
 
開發者ID:jason-lang,項目名稱:jason-eclipse-plugin,代碼行數:65,代碼來源:NewJasonProjectWizardPage.java


注:本文中的org.eclipse.swt.widgets.Combo.addListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。