Java Code Examples for org.eclipse.swt.custom.CCombo

The following examples show how to use org.eclipse.swt.custom.CCombo. These examples are extracted from open source projects. 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 Project: pentaho-kettle   Author: pentaho   File: XsltDialog.java    License: Apache License 2.0 6 votes vote down vote up
private void PopulateFields( CCombo cc ) {
  if ( cc.isDisposed() ) {
    return;
  }
  try {
    String initValue = cc.getText();
    cc.removeAll();
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      cc.setItems( r.getFieldNames() );
    }
    if ( !Utils.isEmpty( initValue ) ) {
      cc.setText( initValue );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "XsltDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "XsltDialog.FailedToGetFields.DialogMessage" ), ke );
  }

}
 
Example #2
Source Project: hop   Author: project-hop   File: TableView.java    License: Apache License 2.0 6 votes vote down vote up
private void applyComboChange( TableItem row, int rownr, int colnr ) {
  String textData;
  if ( combo instanceof ComboVar ) {
    textData = ( (ComboVar) combo ).getText();
  } else {
    textData = ( (CCombo) combo ).getText();
  }
  row.setText( colnr, textData );
  combo.dispose();

  String[] afterEdit = getItemText( row );
  checkChanged( new String[][] { beforeEdit }, new String[][] { afterEdit }, new int[] { rownr } );

  selectionStart = -1;

  fireContentChangedListener( rownr, colnr, textData );
}
 
Example #3
Source Project: birt   Author: eclipse   File: ExpressionButtonUtil.java    License: Eclipse Public License 1.0 6 votes vote down vote up
public String getExpression( )
{
	if ( control.isDisposed( ) )
	{
		return ""; //$NON-NLS-1$
	}
	if ( control instanceof Text )
	{
		return ( (Text) control ).getText( );
	}
	else if ( control instanceof Combo )
	{
		return ( (Combo) control ).getText( );
	}
	else if ( control instanceof CCombo )
	{
		return ( (CCombo) control ).getText( );
	}
	return ""; //$NON-NLS-1$
}
 
Example #4
Source Project: bonita-studio   Author: bonitasoft   File: OutputParametersMappingSection.java    License: GNU General Public License v2.0 6 votes vote down vote up
private CCombo createSubprocessSourceCombo(final Composite outputMappingControl, final OutputMapping mapping) {
    final CCombo subprocessSourceCombo = getWidgetFactory().createCCombo(outputMappingControl, SWT.BORDER);
    for (final Data subprocessData : callActivityHelper.getCallActivityData()) {
        subprocessSourceCombo.add(subprocessData.getName());
    }
    subprocessSourceCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).indent(15, 0).create());
    subprocessSourceCombo.addListener(SWT.Modify, new Listener() {

        @Override
        public void handleEvent(final Event event) {
            getEditingDomain().getCommandStack()
                    .execute(
                            new SetCommand(getEditingDomain(), mapping,
                                    ProcessPackage.Literals.OUTPUT_MAPPING__SUBPROCESS_SOURCE, subprocessSourceCombo
                                            .getText()));
        }
    });
    if (mapping.getSubprocessSource() != null) {
        subprocessSourceCombo.setText(mapping.getSubprocessSource());
    }
    return subprocessSourceCombo;
}
 
Example #5
Source Project: birt   Author: eclipse   File: ChartUIUtil.java    License: Eclipse Public License 1.0 6 votes vote down vote up
public static String getText( Control control )
{
	if ( control instanceof Text )
	{
		return ( (Text) control ).getText( );
	}
	if ( control instanceof CCombo )
	{
		// Fix a CCombo bug. Since a blank character is added to display the
		// text correctly, trim it when saving.
		return ( (CCombo) control ).getText( ).trim( );
	}
	if ( control instanceof Combo )
	{
		return ( (Combo) control ).getText( );
	}
	return ""; //$NON-NLS-1$
}
 
Example #6
Source Project: typescript.java   Author: angelozerr   File: AbstractFormPage.java    License: MIT License 6 votes vote down vote up
protected CCombo createCombo(Composite parent, String label, IJSONPath path, String[] values, String defaultValue) {
	FormToolkit toolkit = getToolkit();
	Composite composite = toolkit.createComposite(parent, SWT.NONE);
	composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	GridLayout layout = new GridLayout(2, false);
	layout.marginWidth = 0;
	layout.marginBottom = 0;
	layout.marginTop = 0;
	layout.marginHeight = 0;
	layout.verticalSpacing = 0;
	composite.setLayout(layout);

	toolkit.createLabel(composite, label);

	CCombo combo = new CCombo(composite, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
	combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	combo.setItems(values);
	toolkit.adapt(combo, true, false);

	bind(combo, path, defaultValue);
	return combo;
}
 
Example #7
Source Project: tracecompass   Author: tracecompass   File: FilterViewer.java    License: Eclipse Public License 2.0 6 votes vote down vote up
FilterTraceTypeNodeComposite(Composite parent, TmfFilterTraceTypeNode node) {
    super(parent, node);
    fNode = node;
    fTraceTypeMap = getTraceTypeMap(fNode.getTraceTypeId());

    Label label = new Label(this, SWT.NONE);
    label.setText(Messages.FilterViewer_TypeLabel);

    fTypeCombo = new CCombo(this, SWT.DROP_DOWN | SWT.READ_ONLY);
    fTypeCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    fTypeCombo.setItems(fTraceTypeMap.keySet().toArray(new String[0]));
    if (fNode.getTraceTypeId() != null) {
        fTypeCombo.setText(fNode.getName());
    }
    fTypeCombo.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            TraceTypeHelper helper = checkNotNull(fTraceTypeMap.get(fTypeCombo.getText()));
            fNode.setTraceTypeId(helper.getTraceTypeId());
            fNode.setTraceClass(helper.getTraceClass());
            fNode.setName(fTypeCombo.getText());
            fViewer.refresh(fNode);
        }
    });
}
 
Example #8
Source Project: LogViewer   Author: anb0s   File: RuleDialog.java    License: Eclipse Public License 2.0 6 votes vote down vote up
private void createMatchModeCombo(Composite parent) {
    // draw label
    Label comboLabel = new Label(parent,SWT.LEFT);
    comboLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    comboLabel.setText(LogViewerPlugin.getResourceString("preferences.ruleseditor.dialog.matchmode.label")); //$NON-NLS-1$
    // draw combo
    matchModeCombo = new CCombo(parent,SWT.BORDER);
    matchModeCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    matchModeCombo.setEditable(false);
    String[] matchModes = {LogViewerPlugin.getResourceString("preferences.ruleseditor.dialog.matchmode.entry.find"), LogViewerPlugin.getResourceString("preferences.ruleseditor.dialog.matchmode.entry.match")};
    matchModeCombo.setItems(matchModes);
    if(edit) {
        String[] items = matchModeCombo.getItems();
        for(int i = 0 ; i < items.length ; i++) {
            if(items[i].toLowerCase().indexOf(this.data.getMatchMode())!=-1) {
            	matchModeCombo.select(i);
                return;
            }
        }
    }
}
 
Example #9
Source Project: birt   Author: eclipse   File: ChartUIUtil.java    License: Eclipse Public License 1.0 6 votes vote down vote up
public static ComboProxy getInstance( Control control )
{
	if ( control != null && !control.isDisposed( ) )
	{
		if ( control instanceof Combo )
		{
			return new ProxyOfCombo( (Combo) control );
		}
		else if ( control instanceof CCombo )
		{
			return new ProxyOfCCombo( (CCombo) control );
		}
	}

	return null;
}
 
Example #10
Source Project: tesb-studio-se   Author: Talend   File: RouteResourceController.java    License: Apache License 2.0 6 votes vote down vote up
/**
     * DOC nrousseau Comment method "createComboCommand".
     *
     * @param source
     * @return
     */
    private PropertyChangeCommand createComboCommand(CCombo combo) {
        String paramName = (String) combo.getData(PARAMETER_NAME);

        IElementParameter param = elem.getElementParameter(paramName);

        String value = combo.getText();

//        for (int j = 0; j < param.getListItemsValue().length; j++) {
//            if (combo.getText().equals(param.getListItemsDisplayName()[j])) {
//                value = (String) param.getListItemsValue()[j];
//            }
//        }
        if (value.equals(param.getValue())) {
            return null;
        }

        return new PropertyChangeCommand(elem, paramName, value);
    }
 
Example #11
Source Project: birt   Author: eclipse   File: CrosstabFilterConditionBuilder.java    License: Eclipse Public License 1.0 6 votes vote down vote up
private void createValueExpressionButton( Composite parent,
		final CCombo CCombo )
{
	Listener listener = new Listener( ) {

		public void handleEvent( Event event )
		{
			updateButtons( );
		}

	};

	ExpressionProvider provider = getCrosstabExpressionProvider( );

	ExpressionButtonUtil.createExpressionButton( parent,
			CCombo,
			provider,
			designHandle,
			listener );
}
 
Example #12
Source Project: birt   Author: eclipse   File: TextEditor.java    License: Eclipse Public License 1.0 6 votes vote down vote up
protected void handleFormatSelectionEvent( final CCombo combo )
{
	int index = combo.getSelectionIndex( );
	combo.select( -1 );
	switch ( index )
	{
		case 0 :
			String result = " format=\"HTML\""; //$NON-NLS-1$
			textEditor.insert( result );
			break;
		case 1 :
			insertFormat( FormatBuilder.NUMBER );
			break;
		case 2 :
			insertFormat( FormatBuilder.STRING );
			break;
		case 3 :
			insertFormat( FormatBuilder.DATETIME );
			break;
		default :
	}

	textEditor.setFocus( );
}
 
Example #13
Source Project: birt   Author: eclipse   File: ChartExpressionButtonUtil.java    License: Eclipse Public License 1.0 6 votes vote down vote up
public static IExpressionButton createExpressionButton( Composite parent,
		Control control, ExtendedItemHandle eih, IExpressionProvider ep )
{
	boolean isCube = ChartReportItemHelper.instance( )
			.getBindingCubeHandle( eih ) != null;

	boolean isCombo = control instanceof Combo || control instanceof CCombo;

	ChartExpressionHelper eHelper = isCombo ? new ChartExpressionComboHelper( isCube )
			: new ChartExpressionHelper( isCube );

	return new ChartExpressionButton( parent,
			control,
			eih,
			ep,
			eHelper );
}
 
Example #14
Source Project: pentaho-kettle   Author: pentaho   File: VfsFileChooserControls.java    License: Apache License 2.0 5 votes vote down vote up
protected void addFileWidgets() {
  Label wlLocation = new Label( this, SWT.RIGHT );
  wlLocation.setText( BaseMessages.getString( PKG, "VfsFileChooserControls.Location.Label" ) );
  wlLocation.setLayoutData( new FormDataBuilder( ).left( 0, 0 ).top( 0, 0 ).result() );
  wLocation = new CCombo( this, SWT.BORDER | SWT.READ_ONLY );
  List<VFSScheme> availableVFSSchemes = getAvailableVFSSchemes();
  availableVFSSchemes.forEach( scheme -> wLocation.add( scheme.schemeName ) );
  wLocation.addListener( SWT.Selection, event -> {
    this.selectedVFSScheme = availableVFSSchemes.get( wLocation.getSelectionIndex() );
    this.wPath.setText( "" );
  } );
  if ( !availableVFSSchemes.isEmpty() ) {
    wLocation.select( 0 );
    this.selectedVFSScheme = availableVFSSchemes.get( wLocation.getSelectionIndex() );
  }
  wLocation.addModifyListener( lsMod );
  wLocation.setLayoutData(
    new FormDataBuilder().left( 0, 0 ).top( wlLocation, FIELD_LABEL_SEP ).width( FIELD_SMALL ).result() );

  Label wlPath = new Label( this, SWT.RIGHT );
  wlPath.setText( BaseMessages.getString( PKG, "VfsFileChooserControls.Filename.Label" ) );
  wlPath.setLayoutData( new FormDataBuilder().left( 0, 0 ).top( wLocation, FIELDS_SEP ).result() );
  wPath = new TextVar( space, this, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  wPath.addModifyListener( lsMod );
  wPath.setLayoutData( new FormDataBuilder().left( 0, 0 ).top( wlPath, FIELD_LABEL_SEP ).width( FIELD_LARGE + VAR_EXTRA_WIDTH ).result() );

  wbBrowse = new Button( this, SWT.PUSH );
  wbBrowse.setText( BaseMessages.getString( PKG, "System.Button.Browse" ) );
  wbBrowse.addListener( SWT.Selection, event -> browseForFileInputPath() );
  int bOffset = ( wbBrowse.computeSize( SWT.DEFAULT, SWT.DEFAULT, false ).y
    - wPath.computeSize( SWT.DEFAULT, SWT.DEFAULT, false ).y ) / 2;
  wbBrowse.setLayoutData( new FormDataBuilder().left( wPath, FIELD_LABEL_SEP ).top( wlPath, FIELD_LABEL_SEP - bOffset ).result() );
}
 
Example #15
Source Project: pentaho-kettle   Author: pentaho   File: MultiMergeJoinDialog.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Create widgets for join type selection
 *
 * @param lsMod
 */
private void createJoinTypeWidget( final ModifyListener lsMod ) {
  Label joinTypeLabel = new Label( shell, SWT.LEFT );
  joinTypeLabel.setText( BaseMessages.getString( PKG, "MultiMergeJoinDialog.Type.Label" ) );
  props.setLook( joinTypeLabel );
  FormData fdlType = new FormData();
  fdlType.left = new FormAttachment( 0, 0 );
  fdlType.right = new FormAttachment( 15, -margin );
  if ( wInputStepArray.length > 0 ) {
    fdlType.top = new FormAttachment( wInputStepArray[wInputStepArray.length - 1], margin );
  } else {
    fdlType.top = new FormAttachment( wStepname, margin );
  }
  joinTypeLabel.setLayoutData( fdlType );
  joinTypeCombo = new CCombo( shell, SWT.BORDER );
  props.setLook( joinTypeCombo );

  joinTypeCombo.setItems( MultiMergeJoinMeta.join_types );

  joinTypeCombo.addModifyListener( lsMod );
  FormData fdType = new FormData();
  if ( wInputStepArray.length > 0 ) {
    fdType.top = new FormAttachment( wInputStepArray[wInputStepArray.length - 1], margin );
  } else {
    fdType.top = new FormAttachment( wStepname, margin );
  }
  fdType.left = new FormAttachment( 15, 0 );
  fdType.right = new FormAttachment( 35, 0 );
  joinTypeCombo.setLayoutData( fdType );
}
 
Example #16
Source Project: hop   Author: project-hop   File: PipelineExecutionConfigurationDialog.java    License: Apache License 2.0 5 votes vote down vote up
protected void optionsSectionControls() {

    wlLogLevel = new Label( gDetails, SWT.NONE );
    props.setLook( wlLogLevel );
    wlLogLevel.setText( BaseMessages.getString( PKG, "PipelineExecutionConfigurationDialog.LogLevel.Label" ) );
    wlLogLevel.setToolTipText( BaseMessages.getString( PKG, "PipelineExecutionConfigurationDialog.LogLevel.Tooltip" ) );
    FormData fdlLogLevel = new FormData();
    fdlLogLevel.top = new FormAttachment( 0, 10 );
    fdlLogLevel.left = new FormAttachment( 0, 10 );
    wlLogLevel.setLayoutData( fdlLogLevel );

    wLogLevel = new CCombo( gDetails, SWT.READ_ONLY | SWT.BORDER );
    wLogLevel.setToolTipText( BaseMessages.getString( PKG, "PipelineExecutionConfigurationDialog.LogLevel.Tooltip" ) );
    props.setLook( wLogLevel );
    FormData fdLogLevel = new FormData();
    fdLogLevel.top = new FormAttachment( wlLogLevel, -2, SWT.TOP );
    fdLogLevel.width = 350;
    fdLogLevel.left = new FormAttachment( wlLogLevel, 6 );
    wLogLevel.setLayoutData( fdLogLevel );
    wLogLevel.setItems( LogLevel.getLogLevelDescriptions() );

    wClearLog = new Button( gDetails, SWT.CHECK );
    wClearLog.setText( BaseMessages.getString( PKG, "PipelineExecutionConfigurationDialog.ClearLog.Label" ) );
    wClearLog.setToolTipText( BaseMessages.getString( PKG, "PipelineExecutionConfigurationDialog.ClearLog.Tooltip" ) );
    props.setLook( wClearLog );
    FormData fdClearLog = new FormData();
    fdClearLog.top = new FormAttachment( wLogLevel, 10 );
    fdClearLog.left = new FormAttachment( 0, 10 );
    wClearLog.setLayoutData( fdClearLog );

  }
 
Example #17
Source Project: birt   Author: eclipse   File: TextEditor.java    License: Eclipse Public License 1.0 5 votes vote down vote up
private int getContentChoiceType( CCombo typeChoicer, String contentType )
{

	IChoice choice = contentTypeChoiceSet.findChoice( contentType );
	if ( choice == null )
	{
		return -1;
	}
	String displayName = choice.getDisplayName( );
	return typeChoicer.indexOf( displayName );
}
 
Example #18
Source Project: pentaho-kettle   Author: pentaho   File: BaseStepDialog.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Adds the databases with the specified type to the Combo Box component.
 *
 * @param wConnection  the Combo Box component
 * @param databaseType the database type
 */
public void addDatabases( CCombo wConnection, Class<? extends DatabaseInterface> databaseType ) {
  for ( int i = 0; i < transMeta.nrDatabases(); i++ ) {
    DatabaseMeta ci = transMeta.getDatabase( i );
    if ( databaseType == null || ci.getDatabaseInterface().getClass().equals( databaseType ) ) {
      wConnection.add( ci.getName() );
    }
  }
}
 
Example #19
Source Project: pentaho-kettle   Author: pentaho   File: ConfigurationDialog.java    License: Apache License 2.0 5 votes vote down vote up
protected void runConfigurationSectionLayout( Class<?> PKG, String prefix ) {
  cRunConfiguration = new Composite( cContainer, SWT.NONE );
  cRunConfiguration.setLayout( new FormLayout() );
  props.setLook( cRunConfiguration );
  FormData fdLocal = new FormData();
  fdLocal.top = new FormAttachment( 0, Const.FORM_MARGIN );
  fdLocal.right = new FormAttachment( 100, -Const.FORM_MARGIN );
  fdLocal.left = new FormAttachment( 0, Const.FORM_MARGIN );

  cRunConfiguration.setBackground( shell.getBackground() ); // the default looks ugly
  cRunConfiguration.setLayoutData( fdLocal );

  Label wlRunConfiguration = new Label( cRunConfiguration, SWT.LEFT );
  props.setLook( wlRunConfiguration );
  wlRunConfiguration.setText( "Run configuration:" );
  FormData fdlRunConfiguration = new FormData();
  fdlRunConfiguration.top = new FormAttachment( 0 );
  fdlRunConfiguration.left = new FormAttachment( 0 );
  wlRunConfiguration.setLayoutData( fdlRunConfiguration );

  wRunConfiguration = new CCombo( cRunConfiguration, SWT.BORDER );
  props.setLook( wRunConfiguration );
  FormData fdRunConfiguration = new FormData();
  fdRunConfiguration.width = 200;
  fdRunConfiguration.top = new FormAttachment( wlRunConfiguration, Const.FORM_MARGIN );
  fdRunConfiguration.left = new FormAttachment( 0 );
  wRunConfiguration.setLayoutData( fdRunConfiguration );
}
 
Example #20
Source Project: hop   Author: project-hop   File: MultiMergeJoinDialog.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Create widgets for join type selection
 *
 * @param lsMod
 */
private void createJoinTypeWidget( final ModifyListener lsMod ) {
  Label joinTypeLabel = new Label( shell, SWT.LEFT );
  joinTypeLabel.setText( BaseMessages.getString( PKG, "MultiMergeJoinDialog.Type.Label" ) );
  props.setLook( joinTypeLabel );
  FormData fdlType = new FormData();
  fdlType.left = new FormAttachment( 0, 0 );
  fdlType.right = new FormAttachment( 15, -margin );
  if ( wInputTransformArray.length > 0 ) {
    fdlType.top = new FormAttachment( wInputTransformArray[ wInputTransformArray.length - 1 ], margin );
  } else {
    fdlType.top = new FormAttachment( wTransformName, margin );
  }
  joinTypeLabel.setLayoutData( fdlType );
  joinTypeCombo = new CCombo( shell, SWT.BORDER );
  props.setLook( joinTypeCombo );

  joinTypeCombo.setItems( MultiMergeJoinMeta.join_types );

  joinTypeCombo.addModifyListener( lsMod );
  FormData fdType = new FormData();
  if ( wInputTransformArray.length > 0 ) {
    fdType.top = new FormAttachment( wInputTransformArray[ wInputTransformArray.length - 1 ], margin );
  } else {
    fdType.top = new FormAttachment( wTransformName, margin );
  }
  fdType.left = new FormAttachment( 15, 0 );
  fdType.right = new FormAttachment( 35, 0 );
  joinTypeCombo.setLayoutData( fdType );
}
 
Example #21
Source Project: bonita-studio   Author: bonitasoft   File: TabbedPropertySheetWidgetFactory.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
   * Creates a combo box as a part of the form.
   *
   * @param parent
   *            the combo box parent.
   * @param comboStyle
   *            the combo box style.
   * @return the combo box.
   */
  public CCombo createCCombo(Composite parent, int comboStyle) {
      CCombo combo = new CCombo(parent, comboStyle);
      adapt(combo, true, false);
      // Bugzilla 145837 - workaround for no borders on Windows XP
if (getBorderStyle() == SWT.BORDER) {
	combo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
}
      return combo;
  }
 
Example #22
Source Project: birt   Author: eclipse   File: BaseDataDefinitionComponent.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Update query by specified expression.
 * <p>
 * Under shared binding case, update grouping/aggregate attributes of chart
 * model if the selected item is group/aggregate expression.
 */
public void updateQuery( String expression )
{
	if ( getInputControl( ) instanceof CCombo )
	{
		Object checkResult = context.getDataServiceProvider( )
				.checkData( queryType, expression );
		if ( checkResult != null && checkResult instanceof Boolean )
		{
			if ( !( (Boolean) checkResult ).booleanValue( ) )
			{
				// Can't select expressions of one dimension to set
				// on category series and Y optional at one time.

				// did not show the warning since its logic is different
				// from others
				// ChartWizard.showException( ChartWizard.BaseDataDefCom_ID,
				//	Messages.getString( "BaseDataDefinitionComponent.WarningMessage.ExpressionsForbidden" ) ); //$NON-NLS-1$ 
				// setUIText( getInputControl( ), oldQuery );
				return;
			}
		}
	}

	if ( isTableSharedBinding( ) )
	{
		updateQueryForSharedBinding( expression );
	}
	else
	{
		setQueryExpression( expression );
	}

	enableAggEditor(expression);
}
 
Example #23
Source Project: bonita-studio   Author: bonitasoft   File: InputParametersMappingSection.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void updateAvailableValuesInputMappingTargetCombo(final CCombo targetCombo,
        final InputMappingAssignationType assignationType) {
    if (InputMappingAssignationType.DATA == assignationType) {
        for (final Data subprocessData : callActivityHelper.getCallActivityData()) {
            targetCombo.add(subprocessData.getName());
        }
    } else {
        for (final String contractInputOfCalledActivity : callActivityHelper.getCallActivityContractInput()) {
            targetCombo.add(contractInputOfCalledActivity);
        }
    }
}
 
Example #24
Source Project: pentaho-kettle   Author: pentaho   File: LabelCombo.java    License: Apache License 2.0 5 votes vote down vote up
public LabelCombo( Composite composite, int flags, String labelText, String toolTipText ) {
  super( composite, SWT.NONE );
  props.setLook( this );

  int middle = props.getMiddlePct();
  int margin = Const.MARGIN;

  FormLayout formLayout = new FormLayout();
  formLayout.marginWidth = 0;
  formLayout.marginHeight = 0;
  formLayout.marginTop = 0;
  formLayout.marginBottom = 0;

  this.setLayout( formLayout );

  int textFlags = SWT.SINGLE | SWT.LEFT | SWT.BORDER;
  if ( flags != SWT.NONE ) {
    textFlags = flags;
  }

  wCombo = new CCombo( this, textFlags );
  FormData fdText = new FormData();
  fdText.left = new FormAttachment( middle, margin );
  fdText.right = new FormAttachment( 100, 0 );
  wCombo.setLayoutData( fdText );
  wCombo.setToolTipText( toolTipText );

  wLabel = new Label( this, SWT.RIGHT );
  props.setLook( wLabel );
  wLabel.setText( labelText );
  FormData fdLabel = new FormData();
  fdLabel.left = new FormAttachment( 0, 0 );
  fdLabel.right = new FormAttachment( middle, 0 );
  fdLabel.top = new FormAttachment( wCombo, 0, SWT.CENTER );
  wLabel.setLayoutData( fdLabel );
  wLabel.setToolTipText( toolTipText );
}
 
Example #25
Source Project: nebula   Author: eclipse   File: CComboFocusControlListener.java    License: Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @see org.eclipse.nebula.widgets.opal.promptsupport.BaseFocusControlListener#isFilled()
 */
@Override
protected boolean isFilled() {
	final String promptText = PromptSupport.getPrompt(control);
	final String trimmedText = ((CCombo) control).getText().trim();
	if (promptText != null && promptText.equals(trimmedText) && !PromptSupport.isPromptDisplayed(control)) {
		return false;
	}
	return !EMPTY_STRING.equals(trimmedText);
}
 
Example #26
Source Project: uima-uimaj   Author: apache   File: AbstractSection.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * New C combo with tip.
 *
 * @param parent the parent
 * @param tip the tip
 * @return the c combo
 */
protected CCombo newCComboWithTip(Composite parent, String tip) {
  CCombo ccombo = new CCombo(parent, SWT.FLAT | SWT.READ_ONLY);
  toolkit.adapt(ccombo, false, false);
  ccombo.setToolTipText(tip);
  ccombo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
  ccombo.addListener(SWT.Selection, this);
  // Make the CCombo's border visible since CCombo is NOT a widget supported
  // by FormToolkit.
  // needed apparently by RedHat Linux 
  ccombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
  return ccombo;
}
 
Example #27
Source Project: neoscada   Author: eclipse   File: TextComboBoxCellEditor.java    License: Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Object doGetValue ()
{
    final int sel = ( (CCombo)getControl () ).getSelectionIndex ();
    if ( sel < 0 )
    {
        return ( (CCombo)getControl () ).getText ();
    }
    else
    {
        return toString ( this.list.get ( sel ) );
    }
}
 
Example #28
Source Project: CogniCrypt   Author: eclipse-cognicrypt   File: StaticAnalyzerPreferences.java    License: Eclipse Public License 2.0 5 votes vote down vote up
/***
 * This method creates a table with check boxes for the CrySL rule sets.
 */
private void createRulesTable() {
	TableViewerColumn rulesColumn = new TableViewerColumn(table, SWT.FILL);
	TableViewerColumn versionsColumn = new TableViewerColumn(table, SWT.FILL);
	TableViewerColumn rulesURL = new TableViewerColumn(table, SWT.FILL);
	rulesColumn.getColumn().setText(Constants.TABLE_HEADER_RULES);
	versionsColumn.getColumn().setText(Constants.TABLE_HEADER_VERSION);
	rulesURL.getColumn().setText(Constants.TABLE_HEADER_URL);
	rulesColumn.getColumn().setWidth(200);
	versionsColumn.getColumn().setWidth(100);
	rulesURL.getColumn().setWidth(200);

	listOfRulesets = getRulesetsFromPrefs();

	for (Iterator<Ruleset> itr = listOfRulesets.iterator(); itr.hasNext();) {
		Ruleset ruleset = (Ruleset) itr.next();
		ruleset.setVersions(new CCombo(table.getTable(), SWT.NONE));
		String[] items = CrySLUtils.getRuleVersions(ruleset.getFolderName());
		if (items != null) {
			ruleset.getVersions().setItems(items);
			ruleset.getVersions().setItems(CrySLUtils.getRuleVersions(ruleset.getFolderName()));
			ruleset.setSelectedVersion(
					(ruleset.getSelectedVersion().length() > 0) ? ruleset.getSelectedVersion() : ruleset.getVersions().getItem(ruleset.getVersions().getItemCount() - 1));
			ruleset.getVersions().select(ruleset.getVersions().indexOf(ruleset.getSelectedVersion()));
		}
		createRulesTableRow(ruleset);
		ruleset.getVersions().addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				super.widgetSelected(e);

				ruleset.setSelectedVersion(ruleset.getVersions().getItem(ruleset.getVersions().getSelectionIndex()));
			}
		});
	}
}
 
Example #29
Source Project: pentaho-kettle   Author: pentaho   File: JobEntryDialog.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Adds the databases from the job metadata to the combo box.
 *
 * @param wConnection the w connection
 */
public void addDatabases( CCombo wConnection ) {
  for ( int i = 0; i < jobMeta.nrDatabases(); i++ ) {
    DatabaseMeta ci = jobMeta.getDatabase( i );
    wConnection.add( ci.getName() );
  }
}
 
Example #30
Source Project: typescript.java   Author: angelozerr   File: OutputPage.java    License: MIT License 5 votes vote down vote up
private void createJSXSection(Composite parent) {
	FormToolkit toolkit = super.getToolkit();
	Section section = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR);
	section.setDescription(TsconfigEditorMessages.OutputPage_JSXSection_desc);
	section.setText(TsconfigEditorMessages.OutputPage_JSXSection_title);
	TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
	section.setLayoutData(data);

	Composite body = createBody(section);

	CCombo jsxCombo = createCombo(body, TsconfigEditorMessages.OutputPage_jsx_label,
			new JSONPath("compilerOptions.jsx"), new String[] { "", "preserve", "react" });
	Text reactNamespaceText = createText(body, TsconfigEditorMessages.OutputPage_reactNamespace_label,
			new JSONPath("compilerOptions.reactNamespace"), null, "jsxFactory");
}