Java Code Examples for org.eclipse.swt.widgets.Combo#removeAll()

The following examples show how to use org.eclipse.swt.widgets.Combo#removeAll() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HighlightRuleBuilder.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
private void fillStyles( Combo stylesChooser )
{
	stylesChooser.removeAll( );
	styles.clear( );
	stylesChooser.add( NONE_DISPLAY_TEXT );
	for ( Iterator iter = DEUtil.getStyles( ); iter.hasNext( ); )
	{
		StyleHandle styleHandle = (StyleHandle) iter.next( );
		if ( styleHandle.isPredefined( ) )
		{
			continue;
		}
		String styleName = styleHandle.getName( );
		stylesChooser.add( styleName );
		styles.put( styleName, styleHandle );
	}

	if ( handle != null && handle.getStyle( ) != null )
	{
		stylesChooser.setText( handle.getStyle( ).getName( ) );
	}
	else
	{
		stylesChooser.setText( NONE_DISPLAY_TEXT );
	}
}
 
Example 2
Source File: CustomMatchConditionDialog.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 设置Combo下拉列表中的数据
 */
private void setComboData(Combo combo, String[] data) {
	if (combo == null || data == null || data.length == 0) {
		return;
	}
	combo.clearSelection();
	combo.removeAll();
	int i = 0;
	for (String temp : data) {
		combo.add(temp, i++);
	}
}
 
Example 3
Source File: CustomMatchConditionDialog.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 设置Combo下拉列表中的数据
 */
private void setComboData(Combo combo, String[] data) {
	if (combo == null || data == null || data.length == 0) {
		return;
	}
	combo.clearSelection();
	combo.removeAll();
	int i = 0;
	for (String temp : data) {
		combo.add(temp, i++);
	}
}
 
Example 4
Source File: DataDefinitionSelector.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
private void refreshSeriesCombo( Combo cmbSeriesSelect )
{
	ArrayList<String> itemList = new ArrayList<String>( );
	int seriesSize = seriesDefns.size( );
	for ( int i = 1; i <= seriesSize; i++ )
	{
		itemList.add( selectionName + " " + i ); //$NON-NLS-1$
	}
	if( !isPartChart( ) )
	{
		itemList.add( Messages.getString( "DataDefinitionSelector.Text.NewSeries" ) ); //$NON-NLS-1$
	}
	cmbSeriesSelect.removeAll( );
	cmbSeriesSelect.setItems( itemList.toArray( new String[seriesSize] ) );
}
 
Example 5
Source File: AndroidSimOptionsTab.java    From thym with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * @wbp.parser.entryPoint
 */
@Override
public void createControl(Composite parent) {
	Composite comp = new Composite(parent, SWT.NONE);
	setControl(comp);
	comp.setLayout(new GridLayout(1, false));
	Group grpProject = new Group(comp, SWT.NONE);
	grpProject.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	grpProject.setText("Project");
	grpProject.setLayout(new GridLayout(3, false));
	
	Label lblProject = new Label(grpProject, SWT.NONE);
	lblProject.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	lblProject.setText("Project:");
	
	textProject = new Text(grpProject, SWT.BORDER);
	textProject.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	textProject.addListener(SWT.Modify, dirtyListener);
	
	Button btnProjectBrowse = new Button(grpProject, SWT.NONE);
	btnProjectBrowse.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			ElementListSelectionDialog es = new ElementListSelectionDialog(getShell(), WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
			es.setTitle("Project Selection");
			es.setMessage("Select a project to run");
			es.setElements(HybridCore.getHybridProjects().toArray());
			if (es.open() == Window.OK) {			
				HybridProject project = (HybridProject) es.getFirstResult();
				textProject.setText(project.getProject().getName());
			}		
		}
	});
	btnProjectBrowse.setText("Browse...");
	
	Group grpEmulator = new Group(comp, SWT.NONE);
	grpEmulator.setLayout(new GridLayout(2, false));
	grpEmulator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	grpEmulator.setText("Emulator");
	
	Label lblVirtualDeviceavd = new Label(grpEmulator, SWT.NONE);
	lblVirtualDeviceavd.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	lblVirtualDeviceavd.setText("Virtual Device (AVD):");
	
	AVDCombo = new Combo(grpEmulator, SWT.READ_ONLY);
	AVDCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	AVDCombo.add("", 0);
	AVDCombo.addListener(SWT.Selection, dirtyListener);

	
	
	Label lblLogFilter = new Label(grpEmulator, SWT.NONE);
	lblLogFilter.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	lblLogFilter.setText("Log Filter:");
	
	logFilterTxt = new Text(grpEmulator, SWT.BORDER);
	logFilterTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	logFilterTxt.addListener(SWT.Modify, dirtyListener);
	try {
		AndroidSDKManager sdk = AndroidSDKManager.getManager();
		avds = sdk.listAVDs();
		for (AndroidAVD avd : avds) {
			AVDCombo.add(avd.getName());
		}
	} catch (CoreException e1) {
		AVDCombo.removeAll();// let it fallback to default
	}
}
 
Example 6
Source File: ConfigurationSettingsWizardPage.java    From saros with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Setups gateway SWT controls by populating a gateway combobox and configuring an information
 * Label and the enabling checkbox.
 *
 * @param combo {@link Combo} selector to populate with discovered gateways
 * @param info {@link Label} displaying status information of the discovery
 * @param checkbox {@link Button} checkbox to enable/disable UPnP support
 */
private void populateGatewaySelectionControls(
    List<GatewayDevice> gateways, final Combo combo, final Label info, final Button checkbox) {

  combo.setEnabled(false);
  checkbox.setEnabled(false);
  combo.removeAll();

  // if no devices are found, return now - nothing to populate
  if (gateways == null || gateways.isEmpty()) {
    info.setText(Messages.UPnPUIUtils_no_gateway);
    info.getParent().pack();
    return;
  }

  this.gateways = new ArrayList<GatewayDevice>();

  // insert found gateways into combobox
  for (GatewayDevice gw : gateways) {
    try {
      String name = gw.getFriendlyName();
      if (!gw.isConnected()) name += Messages.UPnPUIUtils_disconnected;

      combo.add(name);
      this.gateways.add(gw);

    } catch (Exception e) {
      log.debug("Error updating UPnP selector:" + e.getMessage()); // $NON-NLS-1$
      // ignore faulty gateway
    }
  }

  // if valid gateway found, show info and enable
  if (combo.getItemCount() > 0) {
    checkbox.setEnabled(true);
    combo.setEnabled(true);
    combo.select(0);
    combo.pack();
    info.setVisible(false);
  } else {
    info.setText(Messages.UPnPUIUtils_no_valid_gateway);
  }
  info.getParent().pack();
}
 
Example 7
Source File: TimeGraphFindDialog.java    From tracecompass with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * Updates the given combo with the given content.
 *
 * @param combo
 *            combo to be updated
 * @param content
 *            to be put into the combo
 */
private static void updateCombo(Combo combo, List<String> content) {
    combo.removeAll();
    for (int i = 0; i < content.size(); i++) {
        combo.add(content.get(i).toString());
    }
}
 
Example 8
Source File: FindReplaceDialog.java    From translationstudio8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Updates the given combo with the given content.
 * @param combo
 *            combo to be updated
 * @param content
 *            to be put into the combo
 */
private void updateCombo(Combo combo, List<String> content) {
	combo.removeAll();
	for (int i = 0; i < content.size(); i++) {
		combo.add(content.get(i));
	}
}
 
Example 9
Source File: TermBaseSearchDialog.java    From translationstudio8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Updates the given combo with the given content.
 * @param combo
 *            combo to be updated
 * @param content
 *            to be put into the combo
 */
private void updateCombo(Combo combo, List<String> content) {
	combo.removeAll();
	for (int i = 0; i < content.size(); i++) {
		combo.add(content.get(i));
	}
}
 
Example 10
Source File: ConcordanceSearchDialog.java    From translationstudio8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Updates the given combo with the given content.
 * @param combo
 *            combo to be updated
 * @param content
 *            to be put into the combo
 */
private void updateCombo(Combo combo, List<String> content) {
	combo.removeAll();
	for (int i = 0; i < content.size(); i++) {
		combo.add(content.get(i));
	}
}
 
Example 11
Source File: FindReplaceDialog.java    From tmxeditor8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Updates the given combo with the given content.
 * @param combo
 *            combo to be updated
 * @param content
 *            to be put into the combo
 */
private void updateCombo(Combo combo, List<String> content) {
	combo.removeAll();
	for (int i = 0; i < content.size(); i++) {
		combo.add(content.get(i));
	}
}
 
Example 12
Source File: TermBaseSearchDialog.java    From tmxeditor8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Updates the given combo with the given content.
 * @param combo
 *            combo to be updated
 * @param content
 *            to be put into the combo
 */
private void updateCombo(Combo combo, List<String> content) {
	combo.removeAll();
	for (int i = 0; i < content.size(); i++) {
		combo.add(content.get(i));
	}
}
 
Example 13
Source File: ConcordanceSearchDialog.java    From tmxeditor8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Updates the given combo with the given content.
 * @param combo
 *            combo to be updated
 * @param content
 *            to be put into the combo
 */
private void updateCombo(Combo combo, List<String> content) {
	combo.removeAll();
	for (int i = 0; i < content.size(); i++) {
		combo.add(content.get(i));
	}
}