本文整理匯總了Java中org.eclipse.swt.widgets.Combo.add方法的典型用法代碼示例。如果您正苦於以下問題:Java Combo.add方法的具體用法?Java Combo.add怎麽用?Java Combo.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Combo
的用法示例。
在下文中一共展示了Combo.add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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");
}
示例2: 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;
}
示例3: 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());
}
});
}
示例4: addRefCombovalues
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
private void addRefCombovalues(Combo combo, String paramType) {
if(!PrimitiveType.isPrimitiveSig(paramType)) {
combo.add("null");
IType owner = (IType) method.getParent();
try {
IField[] fields = owner.getFields();
for(IField f : fields)
if(Flags.isStatic(f.getFlags()) && f.getTypeSignature().equals(paramType))
combo.add(f.getElementName());
} catch (JavaModelException e1) {
e1.printStackTrace();
}
}
}
示例5: addCombovalues
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
private void addCombovalues(Combo combo, String paramType) {
if(!PrimitiveType.isPrimitiveSig(paramType)) {
String sel = combo.getText();
combo.removeAll();
combo.add("null");
IType owner = (IType) method.getParent();
try {
IField[] fields = owner.getFields();
for(IField f : fields)
if(Flags.isStatic(f.getFlags()) && f.getTypeSignature().equals(paramType))
combo.add(f.getElementName());
} catch (JavaModelException e1) {
e1.printStackTrace();
}
if(sel.isEmpty())
combo.select(0);
else
combo.setText(sel);
}
}
示例6: createChildMandatoryGroup
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
private void createChildMandatoryGroup(final Group parent) {
final GridLayout gridLayout = new GridLayout();
gridLayout.marginHeight = 10;
final GridData gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalAlignment = GridData.FILL;
final Group group = new Group(parent, SWT.NONE);
group.setLayout(gridLayout);
group.setLayoutData(gridData);
group.setText(ResourceString.getResourceString("label.mandatory"));
childCardinalityCombo = new Combo(group, SWT.NONE);
childCardinalityCombo.setLayoutData(gridData);
childCardinalityCombo.setVisibleItemCount(5);
childCardinalityCombo.add("1..n");
childCardinalityCombo.add("0..n");
childCardinalityCombo.add(Relation.CHILD_CARDINALITY_1);
childCardinalityCombo.add("0..1");
}
示例7: createControl
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent) {
container = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
container.setLayout(layout);
layout.numColumns = 2;
Label labelExampleSelection = new Label(container, SWT.NONE);
labelExampleSelection.setText("Select example to be created:");
combo = new Combo(container, SWT.READ_ONLY);
if (availableExamples != null) {
for (String exampleName : availableExamples.keySet()) {
combo.add(exampleName);
}
}
combo.addSelectionListener(this);
setControl(container);
setPageComplete(false);
}
示例8: populateCombo
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
/**
* Populates the combo with the specified values. The specified initial
* value is set as the initial selection it it appears in the array of
* values, otherwise the first value is selected.
*
* @param combo
* The combo to populate.
*
* @param values
* The values for the combo drop down.
*
* @param initialValue
* The value which should be the initial selected value.
*
* @return The index of the selected item.
*/
public static int populateCombo(final Combo combo, final String[] values, final String initialValue) {
Check.notNull(combo, "combo"); //$NON-NLS-1$
Check.notNull(values, "values"); //$NON-NLS-1$
if (values.length == 0) {
return -1;
}
int selectedIndex = 0;
for (int i = 0; i < values.length; i++) {
final String value = values[i];
if (value.equals(initialValue)) {
selectedIndex = i;
}
combo.add(value);
}
combo.select(selectedIndex);
setVisibleItemCount(combo);
return selectedIndex;
}
示例9: init
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
void init() {
// this.setLayout(new GridLayout(2, false));
this.setLayout(new FillLayout());
day = new Combo(this, SWT.READ_ONLY);
for (int i=1; i<=31; ++i)
day.add(""+i);
day.select(0);
day.pack();
// day.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
month = new Combo(this, SWT.READ_ONLY);
for (int i=1; i<=12; ++i)
month.add(""+i);
month.select(0);
month.pack();
// month.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
year = new StyledText(this, SWT.SINGLE | SWT.CENTER | SWT.LEFT | SWT.BORDER);
year.setText("2000");
// year.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
this.pack();
addListener();
}
示例10: addSecondSection
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
private void addSecondSection(Composite parent, Preferences prefs) {
Composite composite = createDefaultComposite(parent);
// Label for owner field
Label ownerLabel = new Label(composite, SWT.NONE);
ownerLabel.setText(MINIFIER_TITLE);
// Create a single-selection list
selection = new Combo(composite, SWT.READ_ONLY);
// Add the items, one by one
for (int i = 0; i < options()[0].length; i++) {
selection.add(options()[1][i]);
}
selection.setText(options()[1][0]);
// Set current selection
String minifier = prefs.get(preferenceKey(MinifyBuilder.MINIFIER),
MinifyBuilder.DONT_MINIFY);
if (!minifier.equals(MinifyBuilder.DONT_MINIFY)) {
for (int i = 0; i < options()[0].length; i++) {
if (minifier.equals(options()[0][i])) {
selection.setText(options()[1][i]);
break;
}
}
}
}
示例11: createAttributeCombo
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
private Combo createAttributeCombo ()
{
final Combo c = new Combo ( this, SWT.NONE );
c.add ( "sourceTimestamp" ); //$NON-NLS-1$
c.add ( "entryTimestamp" ); //$NON-NLS-1$
for ( final Event.Fields field : Event.Fields.values () )
{
c.add ( field.getName () );
}
c.add ( Messages.custom_field );
c.select ( 0 );
return c;
}
示例12: createTypeCombo
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
private Combo createTypeCombo ()
{
final Combo c = new Combo ( this, SWT.NONE );
for ( final Type type : Type.values () )
{
c.add ( type.name () );
}
c.select ( 0 );
return c;
}
示例13: createComboConnectionType
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
/**
* This method initializes comboConnectionType
*
*/
private void createComboConnectionType() {
comboConnectionType = new Combo(this, SWT.NONE);
comboConnectionType.add("");
comboConnectionType.add("DIR");
comboConnectionType.add("EIC");
comboConnectionType.add("TCP");
}
示例14: createControl
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
container.setLayout(layout);
layout.numColumns = 2;
layout.verticalSpacing = 9;
Label label = new Label(container, SWT.NULL);
label.setText("&Emulator technology:");
emulatorTechnologyCombo = new Combo(container, SWT.NONE);
String[] tags = EmulatorTechnologyEditor.getTags(null);
for (int i = 0 ; i < tags.length ; i ++) {
emulatorTechnologyCombo.add(tags[i]);
}
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
emulatorTechnologyCombo.setLayoutData(gd);
emulatorTechnologyCombo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
dialogChanged();
}
});
initialize();
//dialogChanged();
setControl(container);
}
示例15: loadComboJarListFromBuildPath
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
@SuppressWarnings("restriction")
private void loadComboJarListFromBuildPath(Combo comboJarList, String newJarName) {
comboJarList.removeAll();
IProject iProject = BuildExpressionEditorDataSturcture.INSTANCE.getCurrentProject();
IJavaProject iJavaProject=null;
try {
iJavaProject = JavaCore.create(iProject);
PackageFragmentRoot srcfragmentRoot= BuildExpressionEditorDataSturcture.INSTANCE.getSrcPackageFragment(iJavaProject);
comboJarList.add(hydrograph.ui.common.util.Constants.ProjectSupport_SRC);
comboJarList.setData(String.valueOf(comboJarList.getItemCount() - 1), srcfragmentRoot);
for (IPackageFragmentRoot iPackageFragmentRoot : iJavaProject.getAllPackageFragmentRoots()) {
if (isJarPresentInLibFolder(iPackageFragmentRoot.getPath())
&& iPackageFragmentRoot.getKind() != IPackageFragmentRoot.K_SOURCE) {
comboJarList.add(iPackageFragmentRoot.getElementName());
comboJarList.setData(String.valueOf(comboJarList.getItemCount() - 1), iPackageFragmentRoot);
}
}
selectAndLoadJarData(newJarName);
} catch (JavaModelException javaModelException) {
LOGGER.error("Error occurred while loading engines-transform jar", javaModelException);
}
finally{
if(iJavaProject!=null){
try {
iJavaProject.close();
} catch (JavaModelException e) {
LOGGER.warn("JavaModelException occurred while closing java-project"+e);
}
}
}
}