Java Code Examples for org.eclipse.swt.custom.CCombo#setLayoutData()

The following examples show how to use org.eclipse.swt.custom.CCombo#setLayoutData() . 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: RemoteFetchLogWizardRemotePage.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
private void createProjectGroup(Composite parent) {
    if (fDefaultProjectName != null) {
        Group projectGroup = new Group(parent, SWT.SHADOW_NONE);
        projectGroup.setText(RemoteMessages.RemoteFetchLogWizardRemotePage_ImportDialogProjectsGroupName);
        GridLayout layout = new GridLayout(1, true);
        projectGroup.setLayout(layout);
        projectGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

        fProjects = new ArrayList<>();
        List<String> projectNames = new ArrayList<>();

        for (IProject project : TraceUtils.getOpenedTmfProjects()) {
            fProjects.add(project);
            projectNames.add(project.getName());
        }

        fCombo = new CCombo(projectGroup, SWT.READ_ONLY);
        fCombo.setToolTipText(RemoteMessages.RemoteFetchLogWizardRemotePage_ImportDialogProjectsGroupName);
        fCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1));
        fCombo.setItems(projectNames.toArray(new String[projectNames.size()]));
        int select = projectNames.indexOf(fDefaultProjectName);
        fCombo.select(select);
    }
}
 
Example 2
Source File: AbstractFormPage.java    From typescript.java with 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 3
Source File: InputURLDialog.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
protected Control createDialogArea(Composite parent) {
      // create composite
      Composite composite = (Composite) super.createDialogArea(parent);
      // create message
      if (message != null) {
          Label label = new Label(composite, SWT.WRAP);
          label.setText(message);
          GridData data = new GridData(GridData.GRAB_HORIZONTAL
                  | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL
                  | GridData.VERTICAL_ALIGN_CENTER);
          data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
          label.setLayoutData(data);
          label.setFont(parent.getFont());
      }
      combo = new CCombo(composite, getInputComboStyle());
      combo.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
              | GridData.HORIZONTAL_ALIGN_FILL));
      combo.addModifyListener(new ModifyListener() {
          public void modifyText(ModifyEvent e) {
              validateInput();
          }
      });
      errorMessageText = new Text(composite, SWT.READ_ONLY | SWT.WRAP);
      errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
              | GridData.HORIZONTAL_ALIGN_FILL));
      errorMessageText.setBackground(errorMessageText.getDisplay()
              .getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
errorMessageText.setForeground(errorMessageText.getDisplay()
		.getSystemColor(SWT.COLOR_RED));
      // Set the error message text
      // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66292
      setErrorMessage(errorMessage);

      applyDialogFont(composite);
      return composite;
  }
 
Example 4
Source File: AbstractSection.java    From uima-uimaj with 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 5
Source File: VfsFileChooserControls.java    From pentaho-kettle with 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 6
Source File: PipelineExecutionConfigurationDialog.java    From hop with 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 7
Source File: LabelCombo.java    From hop with 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 = props.getMargin();

  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 8
Source File: InfobrightLoaderDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
protected CCombo addStandardSelect( String labelMessageKey, Control prevControl, String[] choices ) {
  int vertPad = verticalPadding;
  addStandardLabel( labelMessageKey, prevControl );
  verticalPadding = vertPad;
  CCombo combo = new CCombo( shell, SWT.BORDER );
  combo.setItems( choices );
  combo.addModifyListener( lsMod );
  combo.setLayoutData( standardInputSpacing( prevControl ) );
  return combo;
}
 
Example 9
Source File: NumberRangeDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
private CCombo createLineCombo( ModifyListener lsMod, String lableText, Control prevControl ) {
  // Value line
  Label lable = new Label( shell, SWT.RIGHT );
  lable.setText( lableText );
  props.setLook( lable );
  FormData lableFormData = new FormData();
  lableFormData.left = new FormAttachment( 0, 0 );
  lableFormData.right = new FormAttachment( props.getMiddlePct(), -props.getMargin() );
  // In case it is the first control
  if ( prevControl != null ) {
    lableFormData.top = new FormAttachment( prevControl, props.getMargin() );
  } else {
    lableFormData.top = new FormAttachment( 0, props.getMargin() );
  }
  lable.setLayoutData( lableFormData );

  CCombo control = new CCombo( shell, SWT.BORDER );
  props.setLook( control );
  control.addModifyListener( lsMod );
  FormData widgetFormData = new FormData();
  widgetFormData.left = new FormAttachment( props.getMiddlePct(), 0 );
  // In case it is the first control
  if ( prevControl != null ) {
    widgetFormData.top = new FormAttachment( prevControl, props.getMargin() );
  } else {
    widgetFormData.top = new FormAttachment( 0, props.getMargin() );
  }
  widgetFormData.right = new FormAttachment( 100, 0 );
  control.setLayoutData( widgetFormData );

  return control;
}
 
Example 10
Source File: StandardChartDataSheet.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public Composite createDataSelector( Composite parent )
{
	parentComposite = parent;
	// select the only data set
	if ( itemHandle.getDataBindingType( ) == ReportItemHandle.DATABINDING_TYPE_NONE
			&& itemHandle.getContainer( ) instanceof ModuleHandle )
	{
		DataSetInfo[] dataSets = dataProvider.getAllDataSets( );
		if ( dataProvider.getAllDataCubes( ).length == 0
				&& dataSets.length == 1 )
		{
			dataProvider.setDataSet( dataSets[0] );
		}
	}

	Composite cmpDataSet = ChartUIUtil.createCompositeWrapper( parent );
	{
		cmpDataSet.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	}

	Label label = new Label( cmpDataSet, SWT.NONE );
	{
		label.setText( Messages.getString( "StandardChartDataSheet.Label.SelectDataSet" ) ); //$NON-NLS-1$
		label.setFont( JFaceResources.getBannerFont( ) );
	}

	Composite cmpDetail = new Composite( cmpDataSet, SWT.NONE );
	{
		GridLayout gridLayout = new GridLayout( 2, false );
		gridLayout.marginWidth = 10;
		gridLayout.marginHeight = 0;
		cmpDetail.setLayout( gridLayout );
		cmpDetail.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	}

	Composite compRadios = ChartUIUtil.createCompositeWrapper( cmpDetail );
	{
		GridData gd = new GridData( );
		gd.verticalSpan = 2;
		compRadios.setLayoutData( gd );
	}

	btnInherit = new Button( compRadios, SWT.RADIO );
	btnInherit.setText( Messages.getString( "StandardChartDataSheet.Label.UseReportData" ) ); //$NON-NLS-1$
	btnInherit.addListener( SWT.Selection, this );

	btnUseData = new Button( compRadios, SWT.RADIO );
	btnUseData.setText( Messages.getString( "StandardChartDataSheet.Label.UseDataSet" ) ); //$NON-NLS-1$
	btnUseData.addListener( SWT.Selection, this );

	cmbInherit = new CCombo( cmpDetail, SWT.DROP_DOWN
			| SWT.READ_ONLY
			| SWT.BORDER );
	cmbInherit.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	cmbInherit.addListener( SWT.Selection, this );

	cmbDataItems = new DataItemCombo( cmpDetail, SWT.DROP_DOWN
			| SWT.READ_ONLY
			| SWT.BORDER ) {

		@Override
		public boolean triggerSelection( int index )
		{
			int selectState = selectDataTypes.get( index ).intValue( );
			if ( selectState == SELECT_NEW_DATASET
					|| selectState == SELECT_NEW_DATACUBE )
			{
				return false;
			}
			return true;
		}

		@Override
		public boolean skipSelection( int index )
		{
			//skip out of boundary selection
			if(index>=0){
				int selectState = selectDataTypes.get( index ).intValue( );
				if ( selectState == SELECT_NEXT )
				{
					return true;
				}
			}
				
			return false;
		}
	};
	cmbDataItems.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	cmbDataItems.addListener( SWT.Selection, this );
	cmbDataItems.setVisibleItemCount( 30 );

	initDataSelector( );
	updatePredefinedQueries( );
	checkDataBinding( );
	if ( dataProvider.checkState( IDataServiceProvider.IN_MULTI_VIEWS ) )
	{
		autoSelect( false );
	}
	return cmpDataSet;
}
 
Example 11
Source File: TransExecutionConfigurationDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
protected void optionsSectionControls() {
  wClearLog = new Button( gDetails, SWT.CHECK );
  wClearLog.setText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.ClearLog.Label" ) );
  wClearLog.setToolTipText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.ClearLog.Tooltip" ) );
  props.setLook( wClearLog );
  FormData fdClearLog = new FormData();
  fdClearLog.top = new FormAttachment( 0, 10 );
  fdClearLog.left = new FormAttachment( 0, 10 );
  wClearLog.setLayoutData( fdClearLog );

  wSafeMode = new Button( gDetails, SWT.CHECK );
  wSafeMode.setText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.SafeMode.Label" ) );
  wSafeMode.setToolTipText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.SafeMode.Tooltip" ) );
  props.setLook( wSafeMode );
  FormData fdSafeMode = new FormData();
  fdSafeMode.top = new FormAttachment( wClearLog, 7 );
  fdSafeMode.left = new FormAttachment( 0, 10 );
  wSafeMode.setLayoutData( fdSafeMode );

  wGatherMetrics = new Button( gDetails, SWT.CHECK );
  wGatherMetrics.setText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.GatherMetrics.Label" ) );
  wGatherMetrics.setToolTipText( BaseMessages.getString( PKG,
      "TransExecutionConfigurationDialog.GatherMetrics.Tooltip" ) );
  props.setLook( wGatherMetrics );
  FormData fdGatherMetrics = new FormData();
  fdGatherMetrics.top = new FormAttachment( wSafeMode, 7 );
  fdGatherMetrics.left = new FormAttachment( 0, 10 );
  fdGatherMetrics.bottom = new FormAttachment( 100, -10 );
  wGatherMetrics.setLayoutData( fdGatherMetrics );

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

  wLogLevel = new CCombo( gDetails, SWT.READ_ONLY | SWT.BORDER );
  wLogLevel.setToolTipText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.LogLevel.Tooltip" ) );
  props.setLook( wLogLevel );
  FormData fdLogLevel = new FormData();
  fdLogLevel.top = new FormAttachment( wlLogLevel, -2, SWT.TOP );
  fdLogLevel.width = 180;
  fdLogLevel.left = new FormAttachment( wlLogLevel, 6 );
  wLogLevel.setLayoutData( fdLogLevel );
  wLogLevel.setItems( LogLevel.getLogLevelDescriptions() );
}
 
Example 12
Source File: JobExecutionConfigurationDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
protected void optionsSectionControls() {

    wExpandRemote = new Button( gDetails, SWT.CHECK );
    wExpandRemote.setText( BaseMessages.getString( PKG, "JobExecutionConfigurationDialog.ExpandRemote.Label" ) );
    wExpandRemote
      .setToolTipText( BaseMessages.getString( PKG, "JobExecutionConfigurationDialog.ExpandRemote.Tooltip" ) );
    props.setLook( wExpandRemote );
    FormData fd_expandCheckButton = new FormData();
    fd_expandCheckButton.top = new FormAttachment( 0, 10 );
    fd_expandCheckButton.left = new FormAttachment( 0, 10 );
    wExpandRemote.setLayoutData( fd_expandCheckButton );
    addRunConfigurationListenerForExpandRemoteOption();

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

    wSafeMode = new Button( gDetails, SWT.CHECK );
    wSafeMode.setText( BaseMessages.getString( PKG, "JobExecutionConfigurationDialog.SafeMode.Label" ) );
    wSafeMode.setToolTipText( BaseMessages.getString( PKG, "JobExecutionConfigurationDialog.SafeMode.Tooltip" ) );
    props.setLook( wSafeMode );
    FormData fdSafeMode = new FormData();
    fdSafeMode.top = new FormAttachment( wClearLog, 7 );
    fdSafeMode.left = new FormAttachment( 0, 10 );
    wSafeMode.setLayoutData( fdSafeMode );

    wGatherMetrics = new Button( gDetails, SWT.CHECK );
    wGatherMetrics.setText( BaseMessages.getString( PKG, "JobExecutionConfigurationDialog.GatherMetrics.Label" ) );
    wGatherMetrics.setToolTipText( BaseMessages
        .getString( PKG, "JobExecutionConfigurationDialog.GatherMetrics.Tooltip" ) );
    props.setLook( wGatherMetrics );
    FormData fdGatherMetrics = new FormData();
    fdGatherMetrics.top = new FormAttachment( wSafeMode, 7 );
    fdGatherMetrics.left = new FormAttachment( 0, 10 );
    fdGatherMetrics.bottom = new FormAttachment( 100, -10 );
    wGatherMetrics.setLayoutData( fdGatherMetrics );

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

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

    Label lblStartJob = new Label( gDetails, SWT.RIGHT );
    lblStartJob.setText( BaseMessages.getString( PKG, "JobExecutionConfigurationDialog.StartCopy.Label" ) );
    lblStartJob.setToolTipText( BaseMessages.getString( PKG, "JobExecutionConfigurationDialog.StartCopy.Tooltip" ) );
    props.setLook( lblStartJob );
    FormData fd_lblStartJob = new FormData();
    fd_lblStartJob.top = new FormAttachment( wlLogLevel, 18 );
    fd_lblStartJob.right = new FormAttachment( wlLogLevel, 0, SWT.RIGHT );
    lblStartJob.setLayoutData( fd_lblStartJob );

    wStartCopy = new CCombo( gDetails, SWT.READ_ONLY | SWT.BORDER );
    wStartCopy.setToolTipText( BaseMessages.getString( PKG, "JobExecutionConfigurationDialog.StartCopy.Tooltip" ) );
    props.setLook( wStartCopy );
    FormData fd_startJobCombo = new FormData();
    fd_startJobCombo.top = new FormAttachment( lblStartJob, -2, SWT.TOP );
    fd_startJobCombo.width = 180;
    fd_startJobCombo.left = new FormAttachment( lblStartJob, 6 );
    wStartCopy.setLayoutData( fd_startJobCombo );

    JobMeta jobMeta = (JobMeta) super.abstractMeta;

    String[] names = new String[jobMeta.getJobCopies().size()];
    for ( int i = 0; i < names.length; i++ ) {
      JobEntryCopy copy = jobMeta.getJobCopies().get( i );
      names[i] = getJobEntryCopyName( copy );
    }
    wStartCopy.setItems( names );
  }
 
Example 13
Source File: TransExecutorDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void addResultFilesTab() {

    final CTabItem wTab = new CTabItem( wTabFolder, SWT.NONE );
    wTab.setText( BaseMessages.getString( PKG, "TransExecutorDialog.ResultFiles.Title" ) );
    wTab.setToolTipText( BaseMessages.getString( PKG, "TransExecutorDialog.ResultFiles.Tooltip" ) );

    ScrolledComposite scrolledComposite = new ScrolledComposite( wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL );
    scrolledComposite.setLayout( new FillLayout() );

    Composite wInputComposite = new Composite( scrolledComposite, SWT.NONE );
    props.setLook( wInputComposite );

    FormLayout tabLayout = new FormLayout();
    tabLayout.marginWidth = 15;
    tabLayout.marginHeight = 15;
    wInputComposite.setLayout( tabLayout );

    wlResultFilesTarget = new Label( wInputComposite, SWT.RIGHT );
    props.setLook( wlResultFilesTarget );
    wlResultFilesTarget.setText( BaseMessages.getString( PKG, "TransExecutorDialog.ResultFilesTarget.Label" ) );
    FormData fdlResultFilesTarget = new FormData();
    fdlResultFilesTarget.top = new FormAttachment( 0, 0 );
    fdlResultFilesTarget.left = new FormAttachment( 0, 0 ); // First one in the left
    wlResultFilesTarget.setLayoutData( fdlResultFilesTarget );

    wResultFilesTarget = new CCombo( wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    props.setLook( wResultFilesTarget );
    wResultFilesTarget.addModifyListener( lsMod );
    FormData fdResultFilesTarget = new FormData();
    fdResultFilesTarget.width = 250;
    fdResultFilesTarget.top = new FormAttachment( wlResultFilesTarget, 5 );
    fdResultFilesTarget.left = new FormAttachment( 0, 0 ); // To the right
    wResultFilesTarget.setLayoutData( fdResultFilesTarget );

    // ResultFileNameField
    //
    wlResultFileNameField = new Label( wInputComposite, SWT.RIGHT );
    props.setLook( wlResultFileNameField );
    wlResultFileNameField.setText( BaseMessages.getString( PKG, "TransExecutorDialog.ResultFileNameField.Label" ) );
    FormData fdlResultFileNameField = new FormData();
    fdlResultFileNameField.top = new FormAttachment( wResultFilesTarget, 10 );
    fdlResultFileNameField.left = new FormAttachment( 0, 0 ); // First one in the left
    wlResultFileNameField.setLayoutData( fdlResultFileNameField );

    wResultFileNameField = new TextVar( transMeta, wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    props.setLook( wResultFileNameField );
    wResultFileNameField.addModifyListener( lsMod );
    FormData fdResultFileNameField = new FormData();
    fdResultFileNameField.width = 250;
    fdResultFileNameField.top = new FormAttachment( wlResultFileNameField, 5 );
    fdResultFileNameField.left = new FormAttachment( 0, 0 ); // To the right
    wResultFileNameField.setLayoutData( fdResultFileNameField );

    wInputComposite.pack();
    Rectangle bounds = wInputComposite.getBounds();

    scrolledComposite.setContent( wInputComposite );
    scrolledComposite.setExpandHorizontal( true );
    scrolledComposite.setExpandVertical( true );
    scrolledComposite.setMinWidth( bounds.width );
    scrolledComposite.setMinHeight( bounds.height );

    wTab.setControl( scrolledComposite );
    wTabFolder.setSelection( wTab );
  }
 
Example 14
Source File: PromptSupportSnippet.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
private static void createCCombo(final Group group) {
	group.setLayout(new GridLayout(2, false));
	group.setText("CCombo widget");

	final Label lbl0 = new Label(group, SWT.NONE);
	lbl0.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
	lbl0.setText("No prompt :");

	final CCombo combo0 = new CCombo(group, SWT.BORDER);
	combo0.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

	final Label lbl1 = new Label(group, SWT.NONE);
	lbl1.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
	lbl1.setText("Simple text prompt :");

	final CCombo txt1 = new CCombo(group, SWT.BORDER);
	txt1.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
	PromptSupport.setPrompt("Type anything you want", txt1);

	final Label lbl2 = new Label(group, SWT.NONE);
	lbl2.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
	lbl2.setText("Other style (bold) :");

	final CCombo txt2 = new CCombo(group, SWT.BORDER);
	txt2.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
	PromptSupport.setPrompt("Type anything you want in bold", txt2);
	PromptSupport.setFontStyle(SWT.BOLD, txt2);

	final Label lbl3 = new Label(group, SWT.NONE);
	lbl3.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
	lbl3.setText("Behaviour highlight :");

	final CCombo txt3 = new CCombo(group, SWT.BORDER);
	txt3.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
	PromptSupport.setPrompt("Type anything you want", txt3);
	PromptSupport.setFocusBehavior(FocusBehavior.HIGHLIGHT_PROMPT, txt3);

	final Label lbl4 = new Label(group, SWT.NONE);
	lbl4.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
	lbl4.setText("Change colors :");

	final CCombo txt4 = new CCombo(group, SWT.BORDER);
	txt4.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
	PromptSupport.setPrompt("Type anything you want", txt4);
	PromptSupport.setForeground(txt4.getDisplay().getSystemColor(SWT.COLOR_YELLOW), txt4);
	PromptSupport.setBackground(txt4.getDisplay().getSystemColor(SWT.COLOR_BLACK), txt4);

	final Label lbl5 = new Label(group, SWT.NONE);
	lbl5.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
	lbl5.setText("Change when widget is initialized :");

	final CCombo txt5 = new CCombo(group, SWT.BORDER);
	txt5.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
	txt5.setText("Remove what is typed...");
	txt5.setBackground(txt4.getDisplay().getSystemColor(SWT.COLOR_BLACK));
	txt5.setForeground(txt4.getDisplay().getSystemColor(SWT.COLOR_YELLOW));

	PromptSupport.setPrompt("Type anything you want", txt5);
	PromptSupport.setForeground(txt4.getDisplay().getSystemColor(SWT.COLOR_DARK_BLUE), txt5);
	PromptSupport.setBackground(txt4.getDisplay().getSystemColor(SWT.COLOR_WHITE), txt5);

}
 
Example 15
Source File: ComboVar.java    From hop with Apache License 2.0 4 votes vote down vote up
public ComboVar( IVariables variables, Composite composite, int flags, String toolTipText,
                 IGetCaretPosition getCaretPositionInterface, IInsertText insertTextInterface ) {
  super( composite, SWT.NONE );
  this.toolTipText = toolTipText;
  this.getCaretPositionInterface = getCaretPositionInterface;
  this.insertTextInterface = insertTextInterface;
  this.variables = variables;

  // props.setLook(this);

  // int margin = props.getMargin();
  FormLayout formLayout = new FormLayout();
  formLayout.marginWidth = 0;
  formLayout.marginHeight = 0;
  formLayout.marginTop = 0;
  formLayout.marginBottom = 0;

  this.setLayout( formLayout );

  // Add the variable $ image on the top right of the control
  //
  Label wlImage = new Label( this, SWT.NONE );
  wlImage.setImage( GuiResource.getInstance().getImageVariable() );
  wlImage.setToolTipText( BaseMessages.getString( PKG, "TextVar.tooltip.InsertVariable" ) );
  FormData fdlImage = new FormData();
  fdlImage.top = new FormAttachment( 0, 0 );
  fdlImage.right = new FormAttachment( 100, 0 );
  wlImage.setLayoutData( fdlImage );

  // add a text field on it...
  wCombo = new CCombo( this, flags );
  modifyListenerTooltipText = getModifyListenerTooltipText( wCombo );
  wCombo.addModifyListener( modifyListenerTooltipText );
  FormData fdCombo = new FormData();
  fdCombo.top = new FormAttachment( 0, 0 );
  fdCombo.left = new FormAttachment( 0, 0 );
  fdCombo.right = new FormAttachment( wlImage, 0 );
  wCombo.setLayoutData( fdCombo );

  controlSpaceKeyAdapter = new ControlSpaceKeyAdapter( variables, wCombo, getCaretPositionInterface, insertTextInterface );
  wCombo.addKeyListener( controlSpaceKeyAdapter );


}
 
Example 16
Source File: TransExecutorDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void addResultRowsTab() {

    final CTabItem wTab = new CTabItem( wTabFolder, SWT.NONE );
    wTab.setText( BaseMessages.getString( PKG, "TransExecutorDialog.ResultRows.Title" ) );
    wTab.setToolTipText( BaseMessages.getString( PKG, "TransExecutorDialog.ResultRows.Tooltip" ) );

    ScrolledComposite scrolledComposite = new ScrolledComposite( wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL );
    scrolledComposite.setLayout( new FillLayout() );

    Composite wInputComposite = new Composite( scrolledComposite, SWT.NONE );
    props.setLook( wInputComposite );

    FormLayout tabLayout = new FormLayout();
    tabLayout.marginWidth = 15;
    tabLayout.marginHeight = 15;
    wInputComposite.setLayout( tabLayout );

    wlResultRowsTarget = new Label( wInputComposite, SWT.RIGHT );
    props.setLook( wlResultRowsTarget );
    wlResultRowsTarget.setText( BaseMessages.getString( PKG, "TransExecutorDialog.OutputRowsSource.Label" ) );
    FormData fdlResultRowsTarget = new FormData();
    fdlResultRowsTarget.top = new FormAttachment( 0, 0 );
    fdlResultRowsTarget.left = new FormAttachment( 0, 0 ); // First one in the left
    wlResultRowsTarget.setLayoutData( fdlResultRowsTarget );

    wOutputRowsSource = new CCombo( wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    props.setLook( wOutputRowsSource );
    wOutputRowsSource.addModifyListener( lsMod );
    FormData fdResultRowsTarget = new FormData();
    fdResultRowsTarget.width = 250;
    fdResultRowsTarget.top = new FormAttachment( wlResultRowsTarget, 5 );
    fdResultRowsTarget.left = new FormAttachment( 0, 0 ); // To the right
    wOutputRowsSource.setLayoutData( fdResultRowsTarget );

    wlOutputFields = new Label( wInputComposite, SWT.NONE );
    wlOutputFields.setText( BaseMessages.getString( PKG, "TransExecutorDialog.ResultFields.Label" ) );
    props.setLook( wlOutputFields );
    FormData fdlResultFields = new FormData();
    fdlResultFields.left = new FormAttachment( 0, 0 );
    fdlResultFields.top = new FormAttachment( wOutputRowsSource, 10 );
    wlOutputFields.setLayoutData( fdlResultFields );

    int nrRows = ( transExecutorMeta.getOutputRowsField() != null ? transExecutorMeta.getOutputRowsField().length : 1 );

    ColumnInfo[] ciResultFields =
      new ColumnInfo[] {
        new ColumnInfo( BaseMessages.getString( PKG, "TransExecutorDialog.ColumnInfo.Field" ),
          ColumnInfo.COLUMN_TYPE_TEXT, false, false ),
        new ColumnInfo( BaseMessages.getString( PKG, "TransExecutorDialog.ColumnInfo.Type" ),
          ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaFactory.getValueMetaNames() ),
        new ColumnInfo( BaseMessages.getString( PKG, "TransExecutorDialog.ColumnInfo.Length" ),
          ColumnInfo.COLUMN_TYPE_TEXT, false ),
        new ColumnInfo( BaseMessages.getString( PKG, "TransExecutorDialog.ColumnInfo.Precision" ),
          ColumnInfo.COLUMN_TYPE_TEXT, false ), };

    wOutputFields =
      new TableView( transMeta, wInputComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL
        | SWT.H_SCROLL, ciResultFields, nrRows, false, lsMod, props, false );

    FormData fdResultFields = new FormData();
    fdResultFields.left = new FormAttachment( 0, 0 );
    fdResultFields.top = new FormAttachment( wlOutputFields, 5 );
    fdResultFields.right = new FormAttachment( 100, 0 );
    fdResultFields.bottom = new FormAttachment( 100, 0 );
    wOutputFields.setLayoutData( fdResultFields );
    wOutputFields.getTable().addListener( SWT.Resize, new ColumnsResizer( 0, 25, 25, 25, 25 ) );

    wInputComposite.pack();
    Rectangle bounds = wInputComposite.getBounds();

    scrolledComposite.setContent( wInputComposite );
    scrolledComposite.setExpandHorizontal( true );
    scrolledComposite.setExpandVertical( true );
    scrolledComposite.setMinWidth( bounds.width );
    scrolledComposite.setMinHeight( bounds.height );

    wTab.setControl( scrolledComposite );
    wTabFolder.setSelection( wTab );
  }
 
Example 17
Source File: WorkflowExecutorDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
private void addResultRowsTab() {

    final CTabItem wTab = new CTabItem( wTabFolder, SWT.NONE );
    wTab.setText( BaseMessages.getString( PKG, "JobExecutorDialog.ResultRows.Title" ) );
    wTab.setToolTipText( BaseMessages.getString( PKG, "JobExecutorDialog.ResultRows.Tooltip" ) );

    ScrolledComposite scrolledComposite = new ScrolledComposite( wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL );
    scrolledComposite.setLayout( new FillLayout() );

    Composite wInputComposite = new Composite( scrolledComposite, SWT.NONE );
    props.setLook( wInputComposite );

    FormLayout tabLayout = new FormLayout();
    tabLayout.marginWidth = 15;
    tabLayout.marginHeight = 15;
    wInputComposite.setLayout( tabLayout );

    wlResultRowsTarget = new Label( wInputComposite, SWT.RIGHT );
    props.setLook( wlResultRowsTarget );
    wlResultRowsTarget.setText( BaseMessages.getString( PKG, "JobExecutorDialog.ResultRowsTarget.Label" ) );
    FormData fdlResultRowsTarget = new FormData();
    fdlResultRowsTarget.top = new FormAttachment( 0, 0 );
    fdlResultRowsTarget.left = new FormAttachment( 0, 0 ); // First one in the left
    wlResultRowsTarget.setLayoutData( fdlResultRowsTarget );

    wResultRowsTarget = new CCombo( wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    props.setLook( wResultRowsTarget );
    wResultRowsTarget.addModifyListener( lsMod );
    FormData fdResultRowsTarget = new FormData();
    fdResultRowsTarget.width = 250;
    fdResultRowsTarget.top = new FormAttachment( wlResultRowsTarget, 5 );
    fdResultRowsTarget.left = new FormAttachment( 0, 0 ); // To the right
    wResultRowsTarget.setLayoutData( fdResultRowsTarget );

    wlResultFields = new Label( wInputComposite, SWT.NONE );
    wlResultFields.setText( BaseMessages.getString( PKG, "JobExecutorDialog.ResultFields.Label" ) );
    props.setLook( wlResultFields );
    FormData fdlResultFields = new FormData();
    fdlResultFields.left = new FormAttachment( 0, 0 );
    fdlResultFields.top = new FormAttachment( wResultRowsTarget, 10 );
    wlResultFields.setLayoutData( fdlResultFields );

    int nrRows = ( workflowExecutorMeta.getResultRowsField() != null ? workflowExecutorMeta.getResultRowsField().length : 1 );

    ColumnInfo[] ciResultFields =
      new ColumnInfo[] {
        new ColumnInfo( BaseMessages.getString( PKG, "JobExecutorDialog.ColumnInfo.Field" ),
          ColumnInfo.COLUMN_TYPE_TEXT, false, false ),
        new ColumnInfo( BaseMessages.getString( PKG, "JobExecutorDialog.ColumnInfo.Type" ),
          ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaFactory.getValueMetaNames() ),
        new ColumnInfo( BaseMessages.getString( PKG, "JobExecutorDialog.ColumnInfo.Length" ),
          ColumnInfo.COLUMN_TYPE_TEXT, false ),
        new ColumnInfo( BaseMessages.getString( PKG, "JobExecutorDialog.ColumnInfo.Precision" ),
          ColumnInfo.COLUMN_TYPE_TEXT, false ), };

    wResultRowsFields =
      new TableView( pipelineMeta, wInputComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL
        | SWT.H_SCROLL, ciResultFields, nrRows, false, lsMod, props, false );

    FormData fdResultFields = new FormData();
    fdResultFields.left = new FormAttachment( 0, 0 );
    fdResultFields.top = new FormAttachment( wlResultFields, 5 );
    fdResultFields.right = new FormAttachment( 100, 0 );
    fdResultFields.bottom = new FormAttachment( 100, 0 );
    wResultRowsFields.setLayoutData( fdResultFields );
    wResultRowsFields.getTable().addListener( SWT.Resize, new ColumnsResizer( 0, 25, 25, 25, 25 ) );

    wInputComposite.pack();
    Rectangle bounds = wInputComposite.getBounds();

    scrolledComposite.setContent( wInputComposite );
    scrolledComposite.setExpandHorizontal( true );
    scrolledComposite.setExpandVertical( true );
    scrolledComposite.setMinWidth( bounds.width );
    scrolledComposite.setMinHeight( bounds.height );

    wTab.setControl( scrolledComposite );
    wTabFolder.setSelection( wTab );
  }
 
Example 18
Source File: WorkflowExecutorDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
private void addResultFilesTab() {
  final CTabItem wTab = new CTabItem( wTabFolder, SWT.NONE );
  wTab.setText( BaseMessages.getString( PKG, "JobExecutorDialog.ResultFiles.Title" ) );
  wTab.setToolTipText( BaseMessages.getString( PKG, "JobExecutorDialog.ResultFiles.Tooltip" ) );

  ScrolledComposite scrolledComposite = new ScrolledComposite( wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL );
  scrolledComposite.setLayout( new FillLayout() );

  Composite wInputComposite = new Composite( scrolledComposite, SWT.NONE );
  props.setLook( wInputComposite );

  FormLayout tabLayout = new FormLayout();
  tabLayout.marginWidth = 15;
  tabLayout.marginHeight = 15;
  wInputComposite.setLayout( tabLayout );

  wlResultFilesTarget = new Label( wInputComposite, SWT.RIGHT );
  props.setLook( wlResultFilesTarget );
  wlResultFilesTarget.setText( BaseMessages.getString( PKG, "JobExecutorDialog.ResultFilesTarget.Label" ) );
  FormData fdlResultFilesTarget = new FormData();
  fdlResultFilesTarget.top = new FormAttachment( 0, 0 );
  fdlResultFilesTarget.left = new FormAttachment( 0, 0 ); // First one in the left
  wlResultFilesTarget.setLayoutData( fdlResultFilesTarget );

  wResultFilesTarget = new CCombo( wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  props.setLook( wResultFilesTarget );
  wResultFilesTarget.addModifyListener( lsMod );
  FormData fdResultFilesTarget = new FormData();
  fdResultFilesTarget.width = 250;
  fdResultFilesTarget.top = new FormAttachment( wlResultFilesTarget, 5 );
  fdResultFilesTarget.left = new FormAttachment( 0, 0 ); // To the right
  wResultFilesTarget.setLayoutData( fdResultFilesTarget );

  // ResultFileNameField
  //
  wlResultFileNameField = new Label( wInputComposite, SWT.RIGHT );
  props.setLook( wlResultFileNameField );
  wlResultFileNameField.setText( BaseMessages.getString( PKG, "JobExecutorDialog.ResultFileNameField.Label" ) );
  FormData fdlResultFileNameField = new FormData();
  fdlResultFileNameField.top = new FormAttachment( wResultFilesTarget, 10 );
  fdlResultFileNameField.left = new FormAttachment( 0, 0 ); // First one in the left
  wlResultFileNameField.setLayoutData( fdlResultFileNameField );

  wResultFileNameField = new TextVar( pipelineMeta, wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  props.setLook( wResultFileNameField );
  wResultFileNameField.addModifyListener( lsMod );
  FormData fdResultFileNameField = new FormData();
  fdResultFileNameField.width = 250;
  fdResultFileNameField.top = new FormAttachment( wlResultFileNameField, 5 );
  fdResultFileNameField.left = new FormAttachment( 0, 0 ); // To the right
  wResultFileNameField.setLayoutData( fdResultFileNameField );

  wInputComposite.pack();
  Rectangle bounds = wInputComposite.getBounds();

  scrolledComposite.setContent( wInputComposite );
  scrolledComposite.setExpandHorizontal( true );
  scrolledComposite.setExpandVertical( true );
  scrolledComposite.setMinWidth( bounds.width );
  scrolledComposite.setMinHeight( bounds.height );

  wTab.setControl( scrolledComposite );
  wTabFolder.setSelection( wTab );
}
 
Example 19
Source File: PipelineExecutorDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
private void addResultFilesTab() {

    final CTabItem wTab = new CTabItem( wTabFolder, SWT.NONE );
    wTab.setText( BaseMessages.getString( PKG, "PipelineExecutorDialog.ResultFiles.Title" ) );
    wTab.setToolTipText( BaseMessages.getString( PKG, "PipelineExecutorDialog.ResultFiles.Tooltip" ) );

    ScrolledComposite scrolledComposite = new ScrolledComposite( wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL );
    scrolledComposite.setLayout( new FillLayout() );

    Composite wInputComposite = new Composite( scrolledComposite, SWT.NONE );
    props.setLook( wInputComposite );

    FormLayout tabLayout = new FormLayout();
    tabLayout.marginWidth = 15;
    tabLayout.marginHeight = 15;
    wInputComposite.setLayout( tabLayout );

    wlResultFilesTarget = new Label( wInputComposite, SWT.RIGHT );
    props.setLook( wlResultFilesTarget );
    wlResultFilesTarget.setText( BaseMessages.getString( PKG, "PipelineExecutorDialog.ResultFilesTarget.Label" ) );
    FormData fdlResultFilesTarget = new FormData();
    fdlResultFilesTarget.top = new FormAttachment( 0, 0 );
    fdlResultFilesTarget.left = new FormAttachment( 0, 0 ); // First one in the left
    wlResultFilesTarget.setLayoutData( fdlResultFilesTarget );

    wResultFilesTarget = new CCombo( wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    props.setLook( wResultFilesTarget );
    wResultFilesTarget.addModifyListener( lsMod );
    FormData fdResultFilesTarget = new FormData();
    fdResultFilesTarget.width = 250;
    fdResultFilesTarget.top = new FormAttachment( wlResultFilesTarget, 5 );
    fdResultFilesTarget.left = new FormAttachment( 0, 0 ); // To the right
    wResultFilesTarget.setLayoutData( fdResultFilesTarget );

    // ResultFileNameField
    //
    wlResultFileNameField = new Label( wInputComposite, SWT.RIGHT );
    props.setLook( wlResultFileNameField );
    wlResultFileNameField.setText( BaseMessages.getString( PKG, "PipelineExecutorDialog.ResultFileNameField.Label" ) );
    FormData fdlResultFileNameField = new FormData();
    fdlResultFileNameField.top = new FormAttachment( wResultFilesTarget, 10 );
    fdlResultFileNameField.left = new FormAttachment( 0, 0 ); // First one in the left
    wlResultFileNameField.setLayoutData( fdlResultFileNameField );

    wResultFileNameField = new TextVar( pipelineMeta, wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    props.setLook( wResultFileNameField );
    wResultFileNameField.addModifyListener( lsMod );
    FormData fdResultFileNameField = new FormData();
    fdResultFileNameField.width = 250;
    fdResultFileNameField.top = new FormAttachment( wlResultFileNameField, 5 );
    fdResultFileNameField.left = new FormAttachment( 0, 0 ); // To the right
    wResultFileNameField.setLayoutData( fdResultFileNameField );

    wInputComposite.pack();
    Rectangle bounds = wInputComposite.getBounds();

    scrolledComposite.setContent( wInputComposite );
    scrolledComposite.setExpandHorizontal( true );
    scrolledComposite.setExpandVertical( true );
    scrolledComposite.setMinWidth( bounds.width );
    scrolledComposite.setMinHeight( bounds.height );

    wTab.setControl( scrolledComposite );
    wTabFolder.setSelection( wTab );
  }
 
Example 20
Source File: PipelineExecutorDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
private void addRowGroupTab() {

    final CTabItem wTab = new CTabItem( wTabFolder, SWT.NONE );
    wTab.setText( BaseMessages.getString( PKG, "PipelineExecutorDialog.RowGroup.Title" ) );
    wTab.setToolTipText( BaseMessages.getString( PKG, "PipelineExecutorDialog.RowGroup.Tooltip" ) );

    Composite wInputComposite = new Composite( wTabFolder, SWT.NONE );
    props.setLook( wInputComposite );

    FormLayout tabLayout = new FormLayout();
    tabLayout.marginWidth = 15;
    tabLayout.marginHeight = 15;
    wInputComposite.setLayout( tabLayout );

    // Group size
    //
    wlGroupSize = new Label( wInputComposite, SWT.RIGHT );
    props.setLook( wlGroupSize );
    wlGroupSize.setText( BaseMessages.getString( PKG, "PipelineExecutorDialog.GroupSize.Label" ) );
    FormData fdlGroupSize = new FormData();
    fdlGroupSize.top = new FormAttachment( 0, 0 );
    fdlGroupSize.left = new FormAttachment( 0, 0 );
    wlGroupSize.setLayoutData( fdlGroupSize );

    wGroupSize = new TextVar( pipelineMeta, wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    props.setLook( wGroupSize );
    wGroupSize.addModifyListener( lsMod );
    FormData fdGroupSize = new FormData();
    fdGroupSize.width = 250;
    fdGroupSize.top = new FormAttachment( wlGroupSize, 5 );
    fdGroupSize.left = new FormAttachment( 0, 0 );
    wGroupSize.setLayoutData( fdGroupSize );

    // Group field
    //
    wlGroupField = new Label( wInputComposite, SWT.RIGHT );
    props.setLook( wlGroupField );
    wlGroupField.setText( BaseMessages.getString( PKG, "PipelineExecutorDialog.GroupField.Label" ) );
    FormData fdlGroupField = new FormData();
    fdlGroupField.top = new FormAttachment( wGroupSize, 10 );
    fdlGroupField.left = new FormAttachment( 0, 0 );
    wlGroupField.setLayoutData( fdlGroupField );

    wGroupField = new CCombo( wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    props.setLook( wGroupField );
    wGroupField.addModifyListener( lsMod );
    FormData fdGroupField = new FormData();
    fdGroupField.width = 250;
    fdGroupField.top = new FormAttachment( wlGroupField, 5 );
    fdGroupField.left = new FormAttachment( 0, 0 );
    wGroupField.setLayoutData( fdGroupField );

    // Group time
    //
    wlGroupTime = new Label( wInputComposite, SWT.RIGHT );
    props.setLook( wlGroupTime );
    wlGroupTime.setText( BaseMessages.getString( PKG, "PipelineExecutorDialog.GroupTime.Label" ) );
    FormData fdlGroupTime = new FormData();
    fdlGroupTime.top = new FormAttachment( wGroupField, 10 );
    fdlGroupTime.left = new FormAttachment( 0, 0 ); // First one in the left
    wlGroupTime.setLayoutData( fdlGroupTime );

    wGroupTime = new TextVar( pipelineMeta, wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    props.setLook( wGroupTime );
    wGroupTime.addModifyListener( lsMod );
    FormData fdGroupTime = new FormData();
    fdGroupTime.width = 250;
    fdGroupTime.top = new FormAttachment( wlGroupTime, 5 );
    fdGroupTime.left = new FormAttachment( 0, 0 );
    wGroupTime.setLayoutData( fdGroupTime );

    wTab.setControl( wInputComposite );
    wTabFolder.setSelection( wTab );
  }