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


Java Combo類代碼示例

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


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

示例1: createDialogArea

import org.eclipse.swt.widgets.Combo; //導入依賴的package包/類
@Override
protected Control createDialogArea(Composite parentShell) {
  Composite parent = (Composite) super.createDialogArea(parentShell);
  Composite c = new Composite(parent, SWT.NONE);

  c.setLayout(new GridLayout(2, false));

  Label l = new Label(c, SWT.NONE);
  l.setText("Select device: ");

  final Combo combo = new Combo(c, SWT.BORDER | SWT.READ_ONLY);
  combo.setItems(mDeviceNames);
  int defaultSelection =
      sSelectedDeviceIndex < mDevices.size() ? sSelectedDeviceIndex : 0;
  combo.select(defaultSelection);
  sSelectedDeviceIndex = defaultSelection;

  combo.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent arg0) {
      sSelectedDeviceIndex = combo.getSelectionIndex();
    }
  });

  return parent;
}
 
開發者ID:DroidTesting,項目名稱:android-uiautomatorviewer,代碼行數:27,代碼來源:ScreenshotAction.java

示例2: createCombo

import org.eclipse.swt.widgets.Combo; //導入依賴的package包/類
/**
 * This method initializes combo	
 *
 */
private void createCombo() {
	GridData gridData1 = new GridData();
	gridData1.grabExcessHorizontalSpace = false;
	gridData1.verticalAlignment = GridData.CENTER;
	gridData1.horizontalAlignment = GridData.BEGINNING;
	combo = new Combo(this, SWT.NONE);
	combo.setLayoutData(gridData1);
	combo.add("*");
	combo.add("Screen class");
	combo.add("Criteria");
	combo.add("Extraction rule");
	combo.add("Sheet");
	combo.add("Transaction");
	combo.add("Statement");
	combo.add("Sequence");
	combo.add("Step");
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:22,代碼來源:DatabaseObjectFindDialogComposite.java

示例3: addDragSupport

import org.eclipse.swt.widgets.Combo; //導入依賴的package包/類
private void addDragSupport(final List sourcePackageList, final Combo comboJarList) {
	DragSource dragSource = ExpressionEditorUtil.INSTANCE.getDragSource(sourcePackageList);
	dragSource.addDragListener(new DragSourceAdapter() {
		public void dragSetData(DragSourceEvent event) {
			event.data = formatDataToTransfer(sourcePackageList.getSelection());
		}

		private Object formatDataToTransfer(String[] selection) {
			StringBuffer buffer = new StringBuffer();
			for (String field : selection) {
				buffer.append(field + Constants.DOT + Constants.ASTERISK + SWT.SPACE + Constants.DASH + SWT.SPACE
						+ comboJarList.getItem(comboJarList.getSelectionIndex())
						+ Constants.FIELD_SEPRATOR_FOR_DRAG_DROP);
			}
			return buffer.toString();
		}
	});
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:19,代碼來源:CategoriesDialogSourceComposite.java

示例4: createDialogArea

import org.eclipse.swt.widgets.Combo; //導入依賴的package包/類
protected Control createDialogArea(Composite parent) {
	Composite area = (Composite) super.createDialogArea(parent);
	Composite container = new Composite(area, SWT.NONE);
	RowLayout layout = new RowLayout(SWT.HORIZONTAL);
	container.setLayout(layout);
	// container.setLayoutData(new GridData(GridData.FILL_BOTH));

	// TitleArea中的Title
	setTitle("屬性文件更新");

	// TitleArea中的Message
	setMessage("輸入正確的url地址,以更新文件。\n可提示的屬性數量會根據當前項目存在的jar包,對已有屬性增加或者刪除!");

	Label label = new Label(container, SWT.NONE);
	label.setText("項目URL: ");
	combo = new Combo(container, SWT.DROP_DOWN);
	String[] items = new String[getUrlMap().size()];
	getUrlMap().values().toArray(items);
	combo.setItems(items);
	String url = getPreferedUrl(projectName);
	combo.setText(url);
	combo.setLayoutData(new RowData(400, 30));

	return area;
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:26,代碼來源:UpdateDialog.java

示例5: createStandardCombo

import org.eclipse.swt.widgets.Combo; //導入依賴的package包/類
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,代碼行數:17,代碼來源:ConfigurationFormToolkit.java

示例6: createAssertionCombo

import org.eclipse.swt.widgets.Combo; //導入依賴的package包/類
private Combo createAssertionCombo ()
{
    final Combo c = new Combo ( this, SWT.NONE );
    for ( final Assertion assertion : Assertion.values () )
    {
        c.add ( assertion.toString () );
    }
    c.select ( 0 );
    c.addSelectionListener ( new SelectionAdapter () {
        @Override
        public void widgetSelected ( final SelectionEvent e )
        {
            AssertionComposite.this.orCondition.updateFilter ();
        }
    } );
    final RowData rowData = new RowData ();
    rowData.width = 75;
    c.setLayoutData ( rowData );
    return c;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:21,代碼來源:FilterAdvancedComposite.java

示例7: createControl

import org.eclipse.swt.widgets.Combo; //導入依賴的package包/類
@Override
public void createControl(Composite parent) {
	Composite container = new Composite(parent, SWT.NULL);
	GridLayout gridLayout = new GridLayout();
	container.setLayout(gridLayout);

	skip(container);

	Label explanation = new Label(container, SWT.NONE);
	explanation.setText(MessageUtil.getString("choose_the_execution_context_you_want_to_extend"));

	skip(container);

	ComboViewer comboViewer = new ComboViewer(container, SWT.NONE);
	Combo combo = comboViewer.getCombo();
	combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

	loadAncestor(model);

	setupAncestor(comboViewer);

	setControl(container);
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:24,代碼來源:ExecutionContextSelectionUIPage.java

示例8: attachWidget

import org.eclipse.swt.widgets.Combo; //導入依賴的package包/類
@Override
public void attachWidget(Composite container) {
	defaultELTcom = new Combo(container, SWT.READ_ONLY);
	defaultELTcom.setItems(defaultTextMessage);
	// defaultELTcom.setItems(new String[] {"True","false"});
	// defaultELTcom.setItem(0, "");
	GridData gd_defaultELTTextBox = new GridData(SWT.FILL, SWT.FILL, false,
			false, 1, 1);
	
	if (OSValidator.isMac()) {
		gd_defaultELTTextBox.horizontalIndent=-1;
		gd_defaultELTTextBox.widthHint = textboxWidth+50;
	}
	else{
		gd_defaultELTTextBox.horizontalIndent=1;
		gd_defaultELTTextBox.widthHint = textboxWidth;
	}
		
	defaultELTcom.setLayoutData(gd_defaultELTTextBox);

	widget = defaultELTcom;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:23,代碼來源:ELTDefaultCombo.java

示例9: disabledWidgetsifWholeExpressionIsParameterForAggregateCumulate

import org.eclipse.swt.widgets.Combo; //導入依賴的package包/類
/**
 * @param isParam
 * @param isWholeOperationParameter
 */
private void disabledWidgetsifWholeExpressionIsParameterForAggregateCumulate(Button isParam,
		boolean isWholeOperationParameter) {
	if (isWholeOperationParameter) {
		Text textAccumulator = (Text) isParam.getData(Messages.TEXT_ACCUMULATOR);
		Button isParamAccumulator = (Button) isParam.getData(Messages.ISPARAM_ACCUMULATOR);
		Combo comboDataTypes = (Combo) isParam.getData(Messages.COMBODATATYPES);
		Button button =(Button) isParam.getData(Constants.EXPRESSION_EDITOR_BUTTON1);
	    button.setEnabled(false);
		textAccumulator.setEnabled(false);
		isParamAccumulator.setEnabled(false);
		comboDataTypes.setEnabled(false);
		super.disabledWidgetsifWholeExpressionIsParameter(isParamAccumulator, isWholeOperationParameter);
	}

}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:20,代碼來源:GroupCombineExpressionComposite.java

示例10: addModifyListenerToComboDataTypes

import org.eclipse.swt.widgets.Combo; //導入依賴的package包/類
private void addModifyListenerToComboDataTypes(Combo combo,final AbstractExpressionComposite expressionComposite,MappingSheetRow mappingSheetRow) {
	combo.addModifyListener(new ModifyListener(){
		@Override
		public void modifyText(ModifyEvent e) {
			Combo accumulatorDataType =(Combo)e.widget;
			mappingSheetRow.setComboDataType( accumulatorDataType.getText());
			boolean isValidValue = validate(expressionComposite.getTextAccumulator().getText(),accumulatorDataType.getText());
			if(!isValidValue){
				expressionComposite.getTextAccumulator().setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255,255,000));
			}else{
				expressionComposite.getTextAccumulator().setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255,255,255));
			}
			showHideValidationMessage();
		}
	});
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:17,代碼來源:TransformDialog.java

示例11: getListener

import org.eclipse.swt.widgets.Combo; //導入依賴的package包/類
@Override
public Listener getListener(final PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper, Widget... widgets) {
	final Widget[] widgetList = widgets;

	if (helper != null) {
		txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
	}

	Listener listener = new Listener() {
		@Override
		public void handleEvent(Event event) {
			if (((Combo) widgetList[0]).getText().equals("Parameter") || ((Combo) widgetList[0]).getText().equals("Others")) {
				((Text) widgetList[1]).setVisible(true);
				((Text) widgetList[1]).setFocus();
				txtDecorator.hide();
			} else {
				((Text) widgetList[1]).setVisible(false);
				txtDecorator.hide();
			}
			propertyDialogButtonBar.enableApplyButton(true);
		}
	};
	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:25,代碼來源:ELTSelectionListener.java

示例12: getListener

import org.eclipse.swt.widgets.Combo; //導入依賴的package包/類
@Override
public Listener getListener(final PropertyDialogButtonBar propertyDialogButtonBar, final ListenerHelper helpers, Widget... widgets) {
	final Widget[] widgetList = widgets;
	
	if (helpers != null) {
		widgetConfig = (WidgetConfig) helpers.get(HelperType.WIDGET_CONFIG);
	}
	
	 Listener listener=new Listener() {
		@Override
		public void handleEvent(Event event) {
			String comboValue = ((Combo) widgetList[0]).getText();
			if (comboValue.equals(Messages.CUSTOM)) {
				FilterOperationClassUtility.INSTANCE.createNewClassWizard((Text) widgetList[1], widgetConfig);
				if(helpers.get(HelperType.OPERATION_CLASS_DIALOG_OK_CONTROL) instanceof OperationClassDialog)
				{
					OperationClassDialog operationClassDialog=(OperationClassDialog)helpers.get(HelperType.OPERATION_CLASS_DIALOG_OK_CONTROL);
					operationClassDialog.getShell().setFocus();
				}
					
				propertyDialogButtonBar.enableApplyButton(true);
			}
		}
	};
	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:27,代碼來源:ELTCreateNewClassListener.java

示例13: getListener

import org.eclipse.swt.widgets.Combo; //導入依賴的package包/類
@Override
public Listener getListener(final PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper,
		Widget... widgets) {
	final Widget[] widgetList = widgets;

	Listener listener = new Listener() {
		@Override
		public void handleEvent(Event event) {
			if (StringUtils.equalsIgnoreCase(((Combo) widgetList[0]).getText(), String.valueOf(Boolean.TRUE))) {
				MessageBox messageBox = new MessageBox(Display.getCurrent().getActiveShell(),
						SWT.ICON_INFORMATION | SWT.OK);
				messageBox.setText(INFORMATION);
				messageBox.setMessage("All files at given location will be overwritten.");
				messageBox.open();
			}
		}
	};
	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:20,代碼來源:OverWriteWidgetSelectionListener.java

示例14: addVersionSection

import org.eclipse.swt.widgets.Combo; //導入依賴的package包/類
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,代碼行數:19,代碼來源:VertigoPropertyPage.java

示例15: 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


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