Java Code Examples for org.eclipse.jface.fieldassist.ControlDecoration#setDescriptionText()

The following examples show how to use org.eclipse.jface.fieldassist.ControlDecoration#setDescriptionText() . 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: DocumentWizardPage.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
private Button createRadioButtonMultiple(final Composite compo) {
    final Button radioButtonMultiple = new Button(compo, SWT.RADIO);
    radioButtonMultiple.setText(Messages.radioButtonMultiple);
    radioButtonMultiple.setLayoutData(GridDataFactory.swtDefaults().create());
    final ControlDecoration infoBonita = new ControlDecoration(radioButtonMultiple, SWT.RIGHT);
    infoBonita.show();
    infoBonita.setImage(Pics.getImage(PicsConstants.hint));
    infoBonita.setDescriptionText(Messages.radioButtonMultipleToolTip);

    radioButtonMultiple.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(final SelectionEvent e) {
            if (radioButtonMultiple.getSelection()) {
                updateSingleMultipleStack(true);
            }
        }
    });
    return radioButtonMultiple;
}
 
Example 2
Source File: DataViewer.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
protected void createTitle(Composite parent) {
    Composite titleComposite = widgetFactory.createComposite(parent);
    titleComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).create());
    titleComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());

    Label label = widgetFactory.createLabel(titleComposite, getTitle(), SWT.NONE);
    label.setLayoutData(GridDataFactory.swtDefaults().grab(false, false).create());

    ControlDecoration controlDecoration = new ControlDecoration(label, SWT.RIGHT, titleComposite);
    controlDecoration.setShowOnlyOnFocus(false);
    controlDecoration.setDescriptionText(getTitleDescripiton());
    controlDecoration.setImage(Pics.getImage(PicsConstants.hint));

    Composite toolBarComposite = widgetFactory.createComposite(titleComposite);
    toolBarComposite.setLayout(GridLayoutFactory.fillDefaults().create());
    toolBarComposite.setLayoutData(GridDataFactory.fillDefaults().align(SWT.END, SWT.FILL).grab(true, false).create());
    ToolBar toolBar = new ToolBar(toolBarComposite, SWT.HORIZONTAL | SWT.RIGHT | SWT.NO_FOCUS | SWT.FLAT);
    widgetFactory.adapt(toolBar);
    toolBar.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
    createToolItems(toolBar);
}
 
Example 3
Source File: FieldAssistHelper.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
private void showContentAssistDecoration( AssistField smartField,
		boolean show )
{
	FieldDecoration dec = getCueDecoration( );
	ControlDecoration cd = smartField.controlDecoration;
	if ( show )
	{
		cd.setImage( dec.getImage( ) );
		cd.setDescriptionText( dec.getDescription( ) );
		cd.setShowOnlyOnFocus( true );
		cd.show( );
	}
	else
	{
		cd.hide( );
	}
}
 
Example 4
Source File: ExtractClassWizard.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
protected void updateDecoration(ControlDecoration decoration, RefactoringStatus status) {
	RefactoringStatusEntry highestSeverity= status.getEntryWithHighestSeverity();
	if (highestSeverity != null) {
		Image newImage= null;
		FieldDecorationRegistry registry= FieldDecorationRegistry.getDefault();
		switch (highestSeverity.getSeverity()) {
			case RefactoringStatus.INFO:
				newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage();
				break;
			case RefactoringStatus.WARNING:
				newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage();
				break;
			case RefactoringStatus.FATAL:
			case RefactoringStatus.ERROR:
				newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage();
		}
		decoration.setDescriptionText(highestSeverity.getMessage());
		decoration.setImage(newImage);
		decoration.show();
	} else {
		decoration.setDescriptionText(null);
		decoration.hide();
	}
}
 
Example 5
Source File: DynamicLabelPropertySectionContribution.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
   public void createControl(final Composite composite, final TabbedPropertySheetWidgetFactory widgetFactory, final ExtensibleGridPropertySection extensibleGridPropertySection) {
GridData gd = (GridData) composite.getLayoutData();
gd.grabExcessHorizontalSpace = true;
ControlDecoration controlDecoration = new ControlDecoration(composite.getChildren()[0], SWT.RIGHT);
       controlDecoration.setDescriptionText(Messages.bind(Messages.warningDisplayLabelMaxLength, MAX_LENGTH, MAX_LENGTH));
       controlDecoration.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK));
       expressionViewer = new ExpressionViewer(composite,SWT.BORDER,widgetFactory,editingDomain, ProcessPackage.Literals.FLOW_ELEMENT__DYNAMIC_LABEL);
       expressionViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false));
       expressionViewer.addFilter(new AvailableExpressionTypeFilter(new String[]{ExpressionConstants.CONSTANT_TYPE,ExpressionConstants.VARIABLE_TYPE,ExpressionConstants.PARAMETER_TYPE,ExpressionConstants.SCRIPT_TYPE}));
       expressionViewer.setExpressionNameResolver(new DefaultExpressionNameResolver("displayName"));
       expressionViewer.setInput(eObject) ;
       expressionViewer.setMessage(Messages.dynamicLabelHint) ;
       expressionViewer.addExpressionValidator(new ExpressionLengthValidator(MAX_LENGTH));
       refreshDataBindingContext();
   }
 
Example 6
Source File: SelectDatabaseOutputTypeWizardPage.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
protected Button createNRowsOneColChoice(final Composite choicesComposite, EMFDataBindingContext context) {
    final Button oneColRadio = new Button(choicesComposite, SWT.RADIO);
    oneColRadio.setLayoutData(GridDataFactory.fillDefaults().grab(false, false).create());
    oneColRadio.setText(Messages.nRowOneCol);

    final ControlDecoration oneColDeco = new ControlDecoration(oneColRadio, SWT.RIGHT, choicesComposite);
    oneColDeco.setImage(Pics.getImage(PicsConstants.hint));
    oneColDeco.setDescriptionText(Messages.oneColHint);

    final Label oneColIcon = new Label(choicesComposite, SWT.NONE);
    oneColIcon.setLayoutData(
            GridDataFactory.swtDefaults().align(SWT.BEGINNING, SWT.CENTER).indent(15, 0).grab(true, false).create());

    final UpdateValueStrategy selectImageStrategy = new UpdateValueStrategy();
    selectImageStrategy.setConverter(new Converter(Boolean.class, Image.class) {

        @Override
        public Object convert(Object fromObject) {
            if (fromObject != null && (Boolean) fromObject) {
                return Pics.getImage("column_placeholder.png", ConnectorPlugin.getDefault());
            } else {
                return Pics.getImage("column_placeholder_disabled.png", ConnectorPlugin.getDefault());
            }

        }

    });

    nRowsOneColModeRadioObserveEnabled = SWTObservables.observeEnabled(oneColRadio);
    context.bindValue(SWTObservables.observeImage(oneColIcon), nRowsOneColModeRadioObserveEnabled, null,
            selectImageStrategy);

    return oneColRadio;

}
 
Example 7
Source File: FieldDecoratorProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public ControlDecoration createControlDecorator(final Control control, final String description, final String fieldDecorationType, final int style) {
    final FieldDecoration decorator = getDecorator(fieldDecorationType);
    final ControlDecoration controlDecoration = newControlDecoration(control, style);
    controlDecoration.setImage(decorator.getImage());
    controlDecoration.setDescriptionText(description);
    control.addControlListener(new CellEditorControlAdapter(control));
    return controlDecoration;
}
 
Example 8
Source File: GeneralSectionBuilder.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
private ControlDecoration createTextErrorDecoration(Text text, String decorationDescription, Image decorationImage) {
	ControlDecoration decoration = new ControlDecoration(text, SWT.RIGHT);
	decoration.setImage(decorationImage);  
	decoration.setDescriptionText(decorationDescription);  
	decoration.hide();
	return decoration;
}
 
Example 9
Source File: ParameterComposite.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public ParameterComposite(Composite parent, int style, AbstractTemplate template, IParameterPage parameterPage) {
	super(parent, style);
	this.template = template;
	this.parameterPage = parameterPage;
	setLayout(new GridLayout(2, false));
	for (TemplateVariable variable : template.getVariables()) {
		Composite varParent = variable.getContainer() == null ? this : variable.getContainer().getWidget();
		if (variable.isLabeled()) {
			Label label = new Label(varParent, SWT.NONE);
			label.setText(variable.getLabel());
			label.setToolTipText(variable.getDescription());
			label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
			variable.createWidget(this, varParent);
			variable.getWidget().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
		} else {
			variable.createWidget(this, varParent);
			variable.getWidget().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
		}
		if (variable.getDescription() != null) {
			ControlDecoration decorator = new ControlDecoration(variable.getWidget(), SWT.RIGHT | SWT.TOP, varParent);
			decorator.setDescriptionText(variable.getDescription());
			decorator.setImage(
					FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage());
		}
	}
	update();
}
 
Example 10
Source File: AdvancedNewProjectPage.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
protected ControlDecoration InfoDecoration(Control control, String text) {
	FieldDecoration infoField = FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION);
	ControlDecoration controlDecoration = new ControlDecoration(control, (SWT.TOP + SWT.RIGHT));
	controlDecoration.setImage(infoField.getImage());
	controlDecoration.setDescriptionText(text);
	controlDecoration.setShowHover(true);
	return controlDecoration;
}
 
Example 11
Source File: MedicationComposite.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
private void initControlDecoration(){
	ctrlDecor = new ControlDecoration(btnConfirm, SWT.TOP);
	ctrlDecor.setDescriptionText(Messages.MedicationComposite_decorConfirm);
	Image imgWarn = FieldDecorationRegistry.getDefault()
		.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage();
	ctrlDecor.setImage(imgWarn);
}
 
Example 12
Source File: ClaferValidation.java    From CogniCrypt with Eclipse Public License 2.0 5 votes vote down vote up
public static boolean validateClaferInheritance(final String inheritanceName, final boolean required, final ControlDecoration decoration) {
	boolean valid = true;

	final String result = getInheritanceValidationMessage(inheritanceName, required);
	if (!result.isEmpty()) {
		decoration.setImage(UIConstants.DEC_ERROR);
		decoration.setDescriptionText(result);
		decoration.show();
		valid = false;
	} else {
		decoration.hide();
	}

	return valid;
}
 
Example 13
Source File: TransitionOrderingPropertySection.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
protected void createExplanationLabel(final Composite mainComposite) {
    final Label explanationLabel = getWidgetFactory().createLabel(mainComposite, Messages.transitionOrderingExplanation_Short,SWT.WRAP);
    explanationLabel.setLayoutData(GridDataFactory.swtDefaults().grab(false, false).span(2, 1).create());
    final ControlDecoration cd = new ControlDecoration(explanationLabel, SWT.RIGHT);
    final FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault()
            .getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION);
    cd.setImage(fieldDecoration.getImage());
    cd.setDescriptionText(Messages.transitionOrderingExplanation);
}
 
Example 14
Source File: CheckBoxVar.java    From hop with Apache License 2.0 4 votes vote down vote up
public CheckBoxVar( final IVariables variables, final Composite composite, int flags, String variable ) {
  super( composite, SWT.NONE );

  props.setLook( this );

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

  this.setLayout( formLayout );

  // add a text field on it...
  wBox = new Button( this, flags );
  props.setLook( wBox );
  wText = new TextVar( variables, this, flags | SWT.NO_BACKGROUND );
  wText.getTextWidget().setForeground( GuiResource.getInstance().getColorRed() ); // Put it in a red color to make it
  // shine...
  wText.getTextWidget().setBackground( composite.getBackground() ); // make it blend in with the rest...

  setVariableOnCheckBox( variable );

  controlDecoration = new ControlDecoration( wBox, SWT.CENTER | SWT.LEFT );
  Image image = GuiResource.getInstance().getImageVariable();
  controlDecoration.setImage( image );
  controlDecoration.setDescriptionText( BaseMessages.getString( PKG, "CheckBoxVar.tooltip.InsertVariable" ) );
  controlDecoration.addSelectionListener( new SelectionAdapter() {

    @Override
    public void widgetSelected( SelectionEvent arg0 ) {
      String variableName = VariableButtonListenerFactory.getVariableName( composite.getShell(), variables );
      if ( variableName != null ) {
        setVariableOnCheckBox( "${" + variableName + "}" );
      }
    }
  } );

  FormData fdBox = new FormData();
  fdBox.top = new FormAttachment( 0, 0 );
  fdBox.left = new FormAttachment( 0, image.getBounds().width );
  wBox.setLayoutData( fdBox );

  FormData fdText = new FormData();
  fdText.top = new FormAttachment( 0, 0 );
  fdText.left = new FormAttachment( wBox, props.getMargin() );
  fdText.right = new FormAttachment( 100, 0 );
  wText.setLayoutData( fdText );
}
 
Example 15
Source File: MethodSelectorPage.java    From CogniCrypt with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void createControl(final Composite parent) {
	final Composite container = new Composite(parent, SWT.NULL);
	setControl(container);
	container.setLayout(new GridLayout(2, false));
	new Label(container, SWT.NONE);
	new Label(container, SWT.NONE);

	this.encryptionLabel = new Label(container, SWT.NULL);
	this.encryptionLabel.setText("Select the encryption method:   ");

	final Combo encryptionCombo = new Combo(container, SWT.NONE);
	final GridData gd_combo = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
	gd_combo.widthHint = 140;
	encryptionCombo.setLayoutData(gd_combo);
	new Label(container, SWT.NONE);
	new Label(container, SWT.NONE);

	// Field assist
	final ControlDecoration deco = new ControlDecoration(encryptionCombo, SWT.CENTER | SWT.RIGHT);
	final Image image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK);
	deco.setDescriptionText("Sample text");
	deco.setImage(image);
	deco.setShowOnlyOnFocus(false);
	deco.show();

	final Label decryptionLabel = new Label(container, SWT.NONE);
	decryptionLabel.setText("Select the decryption method:   ");

	final Combo decryptionCombo = new Combo(container, SWT.NONE);
	decryptionCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
	new Label(container, SWT.NONE);
	new Label(container, SWT.NONE);

	final Label keyGenerationLabel = new Label(container, SWT.NONE);
	keyGenerationLabel.setText("Select the keyGeneration method: ");
	final Combo keyGenerationCombo = new Combo(container, SWT.NONE);
	keyGenerationCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));

	try {
		// import project
		this.project.ImportProject(this.projectPath);
		this.project.setProject(UserJavaProject.cloneProject(this.project.getProject().getName()));
		this.project.addPackage(Constants.PRIMITIVE_PACKAGE);
		// Display methods from the imported project in the combo box
		for (final IMethod method : this.project.listOfAllMethods()) {
			encryptionCombo.add(method.getElementName());
			decryptionCombo.add(method.getElementName());
		}

	}
	catch (final CoreException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

}
 
Example 16
Source File: AliasControl.java    From offspring with MIT License 4 votes vote down vote up
public AliasControl(Composite parent, int style, Long accountId,
    INxtService nxt, IStylingEngine engine, IUserService userService,
    UISynchronize sync, IContactsService contactsService) {
  super(parent, style);
  this.accountId = accountId;
  this.nxt = nxt;
  this.user = userService.findUser(accountId);
  this.sync = sync;
  this.contactsService = contactsService;
  GridLayoutFactory.fillDefaults().spacing(10, 5).numColumns(3).applyTo(this);

  /* top bar (name, uri, register) */

  if (user != null && !user.getAccount().isReadOnly()) {
    aliasNameText = new Text(this, SWT.BORDER);
    GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER)
        .hint(100, SWT.DEFAULT).applyTo(aliasNameText);
    aliasNameText.setMessage("name");

    decoAliasNameText = new ControlDecoration(aliasNameText, SWT.TOP
        | SWT.RIGHT);
    decoAliasNameText.setImage(errorImage);
    decoAliasNameText.setDescriptionText("Alias is registered");
    decoAliasNameText.hide();

    aliasURIText = new Text(this, SWT.BORDER);
    GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER)
        .grab(true, false).applyTo(aliasURIText);
    aliasURIText.setMessage("uri");

    aliasRegisterButton = new Button(this, SWT.PUSH);
    GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER)
        .applyTo(aliasRegisterButton);

    aliasRegisterButton.setText("Register");
    aliasRegisterButton.setEnabled(false);

    hookupAliasControls();
  }

  /* bottom bar table viewer */

  paginationContainer = new PaginationContainer(this, SWT.NONE);
  GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true)
      .span(3, 1).applyTo(paginationContainer);

  aliasesViewer = new AliasViewer(paginationContainer.getViewerParent(),
      accountId, nxt, engine, userService, sync, contactsService);
  paginationContainer.setTableViewer(aliasesViewer, 100);

  aliasesViewer.addSelectionChangedListener(new ISelectionChangedListener() {

    @Override
    public void selectionChanged(SelectionChangedEvent event) {}
  });
}
 
Example 17
Source File: CheckBoxVar.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public CheckBoxVar( final VariableSpace space, final Composite composite, int flags, String variable ) {
  super( composite, SWT.NONE );

  props.setLook( this );

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

  this.setLayout( formLayout );

  // add a text field on it...
  wBox = new Button( this, flags );
  props.setLook( wBox );
  wText = new TextVar( space, this, flags | SWT.NO_BACKGROUND );
  wText.getTextWidget().setForeground( GUIResource.getInstance().getColorRed() ); // Put it in a red color to make it
                                                                                  // shine...
  wText.getTextWidget().setBackground( composite.getBackground() ); // make it blend in with the rest...

  setVariableOnCheckBox( variable );

  controlDecoration = new ControlDecoration( wBox, SWT.CENTER | SWT.LEFT );
  Image image = GUIResource.getInstance().getImageVariable();
  controlDecoration.setImage( image );
  controlDecoration.setDescriptionText( BaseMessages.getString( PKG, "CheckBoxVar.tooltip.InsertVariable" ) );
  controlDecoration.addSelectionListener( new SelectionAdapter() {

    @Override
    public void widgetSelected( SelectionEvent arg0 ) {
      String variableName = VariableButtonListenerFactory.getVariableName( composite.getShell(), space );
      if ( variableName != null ) {
        setVariableOnCheckBox( "${" + variableName + "}" );
      }
    }
  } );

  FormData fdBox = new FormData();
  fdBox.top = new FormAttachment( 0, 0 );
  fdBox.left = new FormAttachment( 0, image.getBounds().width );
  wBox.setLayoutData( fdBox );

  FormData fdText = new FormData();
  fdText.top = new FormAttachment( 0, 0 );
  fdText.left = new FormAttachment( wBox, Const.MARGIN );
  fdText.right = new FormAttachment( 100, 0 );
  wText.setLayoutData( fdText );
}
 
Example 18
Source File: IterationPropertySection.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
private void createInputForDataGroup(final TabbedPropertySheetWidgetFactory widgetFactory,
        final Composite dataContent) {
    final Group inputGroup = widgetFactory.createGroup(dataContent, Messages.input);
    inputGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    inputGroup.setLayout(GridLayoutFactory.fillDefaults().numColumns(3).spacing(5, 3).create());

    final Label inputListlabel = widgetFactory.createLabel(inputGroup, Messages.inputList + " *");
    inputListlabel.setLayoutData(GridDataFactory.swtDefaults().align(SWT.RIGHT, SWT.CENTER).create());

    final ControlDecoration inputListlabelDecoration = new ControlDecoration(inputListlabel, SWT.RIGHT);
    inputListlabelDecoration.setMarginWidth(-3);
    inputListlabelDecoration.setDescriptionText(Messages.inputListHint);
    inputListlabelDecoration.setImage(Pics.getImage(PicsConstants.hint));

    final ComboViewer inputListComboViewer = createComboViewer(widgetFactory, inputGroup,
            new ObservableListContentProviderWithProposalListenersForPool());
    inputListComboViewer.getControl().setLayoutData(
            GridDataFactory.fillDefaults().grab(true, false).hint(200, SWT.DEFAULT).indent(5, 0).create());
    inputListComboViewer.addFilter(new ListDataFilter());
    inputListComboViewer.setSorter(new DataViewerSorter());
    final IViewerObservableValue observeSingleSelection = ViewersObservables
            .observeSingleSelection(inputListComboViewer);
    final IObservableValue selectionObservable = ViewersObservables.observeSingleSelection(selectionProvider);
    final IObservableValue observeInputCollectionValue = CustomEMFEditObservables.observeDetailValue(
            Realm.getDefault(), selectionObservable,
            ProcessPackage.Literals.MULTI_INSTANTIABLE__COLLECTION_DATA_TO_MULTI_INSTANTIATE);

    selectionObservable.addValueChangeListener(createInputValueChanged(inputListComboViewer, observeSingleSelection,
            observeInputCollectionValue, false));

    inputListComboViewer.addSelectionChangedListener(createComboSelectionListener(inputListComboViewer, false));
    inputListComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(final SelectionChangedEvent event) {
            updateReturnTypeFromSelectedInputCollection(inputListComboViewer);
        }

    });
    context.bindValue(observeSingleSelection, observeInputCollectionValue);

    final Label label = widgetFactory.createLabel(inputGroup, "");
    label.setImage(Pics.getImage("icon-arrow-down.png"));
    label.setLayoutData(GridDataFactory.fillDefaults().span(3, 1).align(SWT.CENTER, SWT.CENTER).create());

    createIteratorControl(widgetFactory, inputGroup);
}
 
Example 19
Source File: TextVarWarning.java    From hop with Apache License 2.0 4 votes vote down vote up
public TextVarWarning( IVariables variables, Composite composite, int flags ) {
  super( composite, SWT.NONE );

  warningInterfaces = new ArrayList<IWarning>();

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

  this.setLayout( formLayout );

  // add a text field on it...
  wText = new TextVar( variables, this, flags );

  warningControlDecoration = new ControlDecoration( wText, SWT.CENTER | SWT.RIGHT );
  Image warningImage = GuiResource.getInstance().getImageWarning();
  warningControlDecoration.setImage( warningImage );
  warningControlDecoration.setDescriptionText( BaseMessages.getString( PKG, "TextVar.tooltip.FieldIsInUse" ) );
  warningControlDecoration.hide();

  // If something has changed, check the warning interfaces
  //
  wText.addModifyListener( new ModifyListener() {
    public void modifyText( ModifyEvent arg0 ) {

      // Verify all the warning interfaces.
      // Show the first that has a warning to show...
      //
      boolean foundOne = false;
      for ( IWarning warningInterface : warningInterfaces ) {
        IWarningMessage warningSituation =
          warningInterface.getWarningSituation( wText.getText(), wText, this );
        if ( warningSituation.isWarning() ) {
          foundOne = true;
          warningControlDecoration.show();
          warningControlDecoration.setDescriptionText( warningSituation.getWarningMessage() );
          break;
        }
      }
      if ( !foundOne ) {
        warningControlDecoration.hide();
      }
    }
  } );

  FormData fdText = new FormData();
  fdText.top = new FormAttachment( 0, 0 );
  fdText.left = new FormAttachment( 0, 0 );
  fdText.right = new FormAttachment( 100, -warningImage.getBounds().width );
  wText.setLayoutData( fdText );
}
 
Example 20
Source File: GroovyScriptNameDialog.java    From bonita-studio with GNU General Public License v2.0 3 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
	Control control =  super.createDialogArea(parent);
	 ((GridData)control.getLayoutData()).horizontalIndent = 6;
	  final ControlDecoration nameHelp = new ControlDecoration(getText(),SWT.LEFT);
        nameHelp.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK));
        nameHelp.setDescriptionText(Messages.nameHelp);
       
       
        
       
	return control;
}