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

The following examples show how to use org.eclipse.swt.custom.CCombo#setItems() . 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: XsltDialog.java    From pentaho-kettle with 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 File: XsltDialog.java    From hop with 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();
    IRowMeta r = pipelineMeta.getPrevTransformFields( transformName );
    if ( r != null ) {
      cc.setItems( r.getFieldNames() );
    }
    if ( !Utils.isEmpty( initValue ) ) {
      cc.setText( initValue );
    }
  } catch ( HopException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "XsltDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "XsltDialog.FailedToGetFields.DialogMessage" ), ke );
  }

}
 
Example 3
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 4
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 5
Source File: FilterViewer.java    From tracecompass with 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 6
Source File: RuleDialog.java    From LogViewer with 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 7
Source File: RouteResourceController.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
/**
	 *
	 *
	 */
    private void refreshCombo(IElementParameter childParameter) {
        if (childParameter == null) {
            return;
        }
        CCombo combo = (CCombo) hashCurControls.get(childParameter.getName());

        if (combo == null || combo.isDisposed()) {
            return;
        }
        Object value = childParameter.getValue();
        if (value instanceof String) {
            String version = (String) value;
//            String strValue = ""; //$NON-NLS-1$
//            int nbInList = 0, nbMax = childParameter.getListItemsValue().length;
//            while (strValue.equals(new String("")) && nbInList < nbMax) { //$NON-NLS-1$
//                if (name.equals(childParameter.getListItemsValue()[nbInList])) {
//                    strValue = childParameter.getListItemsDisplayName()[nbInList];
//                }
//                nbInList++;
//            }
            String[] paramItems = getListToDisplay(childParameter);
            String[] comboItems = combo.getItems();

            if (!Arrays.equals(paramItems, comboItems)) {
                combo.setItems(paramItems);
            }
            combo.setText(version);
//            combo.setVisible(true);
        }

    }
 
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: IngresVectorwiseLoaderDialog.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;
  Label label = addStandardLabel( labelMessageKey, prevControl );
  verticalPadding = vertPad;
  CCombo combo = new CCombo( shell, SWT.BORDER );
  combo.setItems( choices );
  combo.addModifyListener( lsMod );
  combo.setLayoutData( standardInputSpacing( prevControl, label ) );
  return combo;
}
 
Example 10
Source File: MultiMergeJoinDialog.java    From pentaho-kettle with 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 11
Source File: MultiMergeJoinDialog.java    From hop with 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 12
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 13
Source File: FormatSpecifierComposite.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
private void placeComponents( )
{
	GridLayout glNumberAdvanced = new GridLayout( );
	glNumberAdvanced.verticalSpacing = 5;
	glNumberAdvanced.numColumns = 2;
	glNumberAdvanced.marginHeight = 2;
	glNumberAdvanced.marginWidth = 2;

	GridData gdGRPNumberAdvanced = new GridData( GridData.FILL_BOTH );
	this.setLayoutData( gdGRPNumberAdvanced );
	this.setLayout( glNumberAdvanced );

	lblAdvMultiplier = new Label( this, SWT.NONE );
	GridData gdLBLAdvMultiplier = new GridData( );
	lblAdvMultiplier.setLayoutData( gdLBLAdvMultiplier );
	lblAdvMultiplier.setText( Messages.getString( "FormatSpecifierComposite.Lbl.Multiplier" ) ); //$NON-NLS-1$

	txtAdvMultiplier = new LocalizedNumberEditorComposite( this,
			SWT.BORDER | SWT.SINGLE );
	new TextNumberEditorAssistField( txtAdvMultiplier.getTextControl( ), null );
	
	GridData gdTXTAdvMultiplier = new GridData( GridData.FILL_HORIZONTAL );
	txtAdvMultiplier.setLayoutData( gdTXTAdvMultiplier );
	txtAdvMultiplier.addModifyListener( this );

	lblNumberPattern = new Label( this, SWT.NONE );
	GridData gdLBLNumberPattern = new GridData( );
	lblNumberPattern.setLayoutData( gdLBLNumberPattern );
	lblNumberPattern.setText( Messages.getString( "FormatSpecifierComposite.Lbl.NumberPattern" ) ); //$NON-NLS-1$

	txtNumberPattern = new CCombo( this, SWT.BORDER | SWT.SINGLE );
	GridData gdTXTNumberPattern = new GridData( GridData.FILL_HORIZONTAL );
	txtNumberPattern.setLayoutData( gdTXTNumberPattern );
	txtNumberPattern.addModifyListener( this );
	
	// set sample number patterns
	txtNumberPattern.setItems( new String[]{
			"##.##%", //$NON-NLS-1$
			"##.###", //$NON-NLS-1$
			"00.###", //$NON-NLS-1$
			"##,###.00", //$NON-NLS-1$
			"0.00'K'", //$NON-NLS-1$
			"##0.00 \u00A4", //$NON-NLS-1$
			"###0.000\u2030" //$NON-NLS-1$
	} );
	txtNumberPattern.setVisibleItemCount( txtNumberPattern.getItemCount( ) );
	txtNumberPattern.addSelectionListener( new SelectionAdapter( ) {

		@Override
		public void widgetSelected( SelectionEvent e )
		{

			bEnableEvents = false;
			
			if ( !( formatspecifier instanceof JavaNumberFormatSpecifier ) )
			{
				formatspecifier = JavaNumberFormatSpecifierImpl.create( "" ); //$NON-NLS-1$
			}
			( (JavaNumberFormatSpecifier) formatspecifier ).setPattern( ChartUIUtil.getText( txtNumberPattern ) );

			bEnableEvents = true;

			updatePreview( );
		}
	} );

}
 
Example 14
Source File: FormatSpecifierComposite.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
private void placeComponents( )
{
	GridLayout glDateAdvanced = new GridLayout( );
	glDateAdvanced.verticalSpacing = 5;
	glDateAdvanced.numColumns = 2;
	glDateAdvanced.marginHeight = 2;
	glDateAdvanced.marginWidth = 2;

	GridData gdGRPDateAdvanced = new GridData( GridData.FILL_BOTH );
	this.setLayoutData( gdGRPDateAdvanced );
	this.setLayout( glDateAdvanced );

	lblDatePattern = new Label( this, SWT.NONE );
	GridData gdLBLDatePattern = new GridData( );
	lblDatePattern.setLayoutData( gdLBLDatePattern );
	lblDatePattern.setText( Messages.getString( "FormatSpecifierComposite.Lbl.DatePattern" ) ); //$NON-NLS-1$

	txtDatePattern = new CCombo( this, SWT.BORDER | SWT.SINGLE );
	GridData gdTXTDatePattern = new GridData( GridData.FILL_HORIZONTAL );
	txtDatePattern.setLayoutData( gdTXTDatePattern );
	txtDatePattern.addModifyListener( this );
	
	txtDatePattern.setItems( new String[]{
			"EEEE,MMMM dd,yyyy", //$NON-NLS-1$
			"MM/dd/yy", //$NON-NLS-1$
			"dd-MMM-yy", //$NON-NLS-1$
			"LLL,yyyy", //$NON-NLS-1$
			"hh:mm:ss,a", //$NON-NLS-1$
			"HH:mm:ss", //$NON-NLS-1$
			"D,yyyy", //$NON-NLS-1$
			"DDD,yyyy,QQQQ", //$NON-NLS-1$
			"EEE, MMM d, yyyy", //$NON-NLS-1$
			"yyyy.MMMM.dd GGG hh:mm aaa", //$NON-NLS-1$
			"yyyy.MM.dd G 'at' HH:mm:ss zzz", //$NON-NLS-1$
			"w,yyyy", //$NON-NLS-1$
			"W,LLL,yyyy" //$NON-NLS-1$
	} );
	txtDatePattern.setVisibleItemCount( txtDatePattern.getItemCount( ) );
	txtDatePattern.addSelectionListener( new SelectionAdapter( ) {

		@Override
		public void widgetSelected( SelectionEvent e )
		{
			bEnableEvents = false;

			if ( !( formatspecifier instanceof JavaDateFormatSpecifier ) )
			{
				formatspecifier = JavaDateFormatSpecifierImpl.create( "" ); //$NON-NLS-1$
			}
			( (JavaDateFormatSpecifier) formatspecifier ).setPattern( ChartUIUtil.getText( txtDatePattern ) );

			bEnableEvents = true;

			updatePreview( );
		}
	} );
}
 
Example 15
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 16
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 17
Source File: HopPluginExplorePerspective.java    From hop with Apache License 2.0 4 votes vote down vote up
@Override
public void initialize( HopGui hopGui, Composite parent ) {
	this.hopGui = hopGui;
	this.parent = parent;

	this.loadPlugin();

	PropsUi props = PropsUi.getInstance();

	composite = new Composite( parent, SWT.NONE );
	composite.setLayout( new FormLayout() );

	formData = new FormData();
	formData.left = new FormAttachment( 0, 0 );
	formData.top = new FormAttachment( 0, 0 );
	formData.right = new FormAttachment( 100, 0 );
	formData.bottom = new FormAttachment( 100, 0 );
	composite.setLayoutData( formData );

	Label label = new Label( composite, SWT.LEFT );
	label.setText( "Plugin type" );
	FormData fdlFields = new FormData();
	fdlFields.left = new FormAttachment( 0, 0 );
	fdlFields.top = new FormAttachment( 0, props.getMargin() );
	label.setLayoutData( fdlFields );

	wPluginType = new CCombo( composite, SWT.LEFT | SWT.READ_ONLY | SWT.BORDER );
	wPluginType.setItems( pluginsType );
	wPluginType.setText( selectedPluginType );
	props.setLook( wPluginType );
	FormData fdlSubject = new FormData();
	fdlSubject.left = new FormAttachment( label, props.getMargin() );
	fdlSubject.top = new FormAttachment( label, 0, SWT.CENTER );
	wPluginType.setLayoutData( fdlSubject );

	wPluginType.addSelectionListener( new SelectionAdapter() {
		@Override
		public void widgetSelected( SelectionEvent arg0 ) {
			selectedPluginType = wPluginType.getText();
			refresh();
		}
	} );

	IRowMeta rowMeta = metaMap.get( selectedPluginType );
	ColumnInfo[] colinf = new ColumnInfo[ rowMeta.size() ];
	for ( int i = 0; i < rowMeta.size(); i++ ) {
		IValueMeta v = rowMeta.getValueMeta( i );
		colinf[ i ] = new ColumnInfo( v.getName(), ColumnInfo.COLUMN_TYPE_TEXT, v.isNumeric() );
		colinf[ i ].setToolTip( v.toStringMeta() );
		colinf[ i ].setValueMeta( v );
	}

	wPluginView = new TableView( new Variables(), composite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, colinf, 0,
		null, props );
	wPluginView.setShowingBlueNullValues( true );

	FormData fdFields = new FormData();
	fdFields.left = new FormAttachment( 0, 0 );
	fdFields.top = new FormAttachment( wPluginType, props.getMargin() );
	fdFields.right = new FormAttachment( 100, 0 );
	fdFields.bottom = new FormAttachment( 100, 0 );
	wPluginView.setLayoutData( fdFields );

	this.refresh();
}
 
Example 18
Source File: WorkflowExecutionConfigurationDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
protected void optionsSectionControls() {

    wlLogLevel = new Label( gDetails, SWT.RIGHT );
    wlLogLevel.setText( BaseMessages.getString( PKG, "WorkflowExecutionConfigurationDialog.LogLevel.Label" ) );
    wlLogLevel.setToolTipText( BaseMessages.getString( PKG, "WorkflowExecutionConfigurationDialog.LogLevel.Tooltip" ) );
    props.setLook( wlLogLevel );
    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, "WorkflowExecutionConfigurationDialog.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, "WorkflowExecutionConfigurationDialog.ClearLog.Label" ) );
    wClearLog.setToolTipText( BaseMessages.getString( PKG, "WorkflowExecutionConfigurationDialog.ClearLog.Tooltip" ) );
    props.setLook( wClearLog );
    FormData fdClearLog = new FormData();
    fdClearLog.top = new FormAttachment( wLogLevel, 10 );
    fdClearLog.left = new FormAttachment( 0, 10 );
    wClearLog.setLayoutData( fdClearLog );

    Label wlStartAction = new Label( gDetails, SWT.RIGHT );
    wlStartAction.setText( BaseMessages.getString( PKG, "WorkflowExecutionConfigurationDialog.StartCopy.Label" ) );
    wlStartAction.setToolTipText( BaseMessages.getString( PKG, "WorkflowExecutionConfigurationDialog.StartCopy.Tooltip" ) );
    props.setLook( wlStartAction );
    FormData fdlStartAction = new FormData();
    fdlStartAction.top = new FormAttachment( wClearLog, props.getMargin() );
    fdlStartAction.left = new FormAttachment( 0, 10 );
    wlStartAction.setLayoutData( fdlStartAction );

    wStartAction = new CCombo( gDetails, SWT.READ_ONLY | SWT.BORDER );
    wStartAction.setToolTipText( BaseMessages.getString( PKG, "WorkflowExecutionConfigurationDialog.StartCopy.Tooltip" ) );
    props.setLook( wStartAction );
    FormData fd_startJobCombo = new FormData();
    fd_startJobCombo.top = new FormAttachment( wlStartAction, 0, SWT.CENTER );
    fd_startJobCombo.left = new FormAttachment( wlStartAction, props.getMargin() );
    fd_startJobCombo.right = new FormAttachment( 100, 0 );
    wStartAction.setLayoutData( fd_startJobCombo );

    WorkflowMeta workflowMeta = (WorkflowMeta) super.abstractMeta;

    String[] names = new String[ workflowMeta.getActionCopies().size() ];
    for ( int i = 0; i < names.length; i++ ) {
      ActionCopy copy = workflowMeta.getActionCopies().get( i );
      names[ i ] = getActionCopyName( copy );
    }
    wStartAction.setItems( names );
  }
 
Example 19
Source File: LabelTimeComposite.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public LabelTimeComposite( Composite composite, String labelText, String toolTipText ) {
  super( composite, SWT.NONE );
  props.setLook( this );

  int middle = props.getMiddlePct();
  int threeQuarters = ( middle + 100 ) / 2;
  int margin = Const.MARGIN;

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

  this.setLayout( formLayout );

  wText = new Text( this, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  FormData fdText = new FormData();
  fdText.left = new FormAttachment( middle, margin );
  fdText.right = new FormAttachment( threeQuarters, 0 );
  wText.setLayoutData( fdText );
  wText.setToolTipText( toolTipText );

  wTimeUnit = new CCombo( this, SWT.SINGLE | SWT.DROP_DOWN | SWT.BORDER | SWT.LEFT );
  FormData fdCombo = new FormData();
  fdCombo.left = new FormAttachment( threeQuarters, margin );
  fdCombo.right = new FormAttachment( 100, 0 );
  wTimeUnit.setEditable( false );
  wTimeUnit.setLayoutData( fdCombo );
  wTimeUnit.setItems( getTimeUnits() );
  wTimeUnit.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( wText, 0, SWT.CENTER );
  wLabel.setLayoutData( fdLabel );
  wLabel.setToolTipText( toolTipText );

  wText.addModifyListener( new ModifyListener() {
    public void modifyText( ModifyEvent e ) {
      if ( !StringUtils.isNumeric( wText.getText() ) ) {
        wText.setText( lastValidValue );
      } else {
        lastValidValue = wText.getText();
      }
    }
  } );
}