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

The following examples show how to use org.eclipse.swt.custom.CCombo#setToolTipText() . 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: 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 3
Source File: ComboVar.java    From hop with Apache License 2.0 5 votes vote down vote up
private ModifyListener getModifyListenerTooltipText( final CCombo comboField ) {
  return new ModifyListener() {
    public void modifyText( ModifyEvent e ) {
      String tip = comboField.getText();
      if ( !Utils.isEmpty( tip ) && !Utils.isEmpty( toolTipText ) ) {
        tip += Const.CR + Const.CR + toolTipText;
      }

      if ( Utils.isEmpty( tip ) ) {
        tip = toolTipText;
      }
      comboField.setToolTipText( variables.environmentSubstitute( tip ) );
    }
  };
}
 
Example 4
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 5
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 6
Source File: ComboVar.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private ModifyListener getModifyListenerTooltipText( final CCombo comboField ) {
  return new ModifyListener() {
    public void modifyText( ModifyEvent e ) {
      String tip = comboField.getText();
      if ( !Utils.isEmpty( tip ) && !Utils.isEmpty( toolTipText ) ) {
        tip += Const.CR + Const.CR + toolTipText;
      }

      if ( Utils.isEmpty( tip ) ) {
        tip = toolTipText;
      }
      comboField.setToolTipText( variables.environmentSubstitute( tip ) );
    }
  };
}
 
Example 7
Source File: LabelCombo.java    From pentaho-kettle 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 = 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 8
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 9
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 10
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 11
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();
      }
    }
  } );
}
 
Example 12
Source File: AbstractDialog.java    From uima-uimaj with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the text and tip.
 *
 * @param c the c
 * @param label the label
 * @param tip the tip
 */
protected void setTextAndTip(CCombo c, String label, String tip) {
  c.setText(label);
  c.setToolTipText(tip);
}