Package org.eclipse.jface.fieldassist

Examples of org.eclipse.jface.fieldassist.ControlDecoration


  private void setupPasswordText(Composite paramComposite, KeyListener paramKeyListener) {
    this.passwordLData.width = 176;
    this.passwordLData.height = 19;
    this.passwordLData.top = new FormAttachment(0, 1000, getDistanceFromTop());
    this.password = new Text(paramComposite, 4196352);
    ControlDecoration localControlDecoration = new ControlDecoration(this.password, 131200);
    localControlDecoration.setDescriptionText(requiredDecorator.getDescription());
    localControlDecoration.setImage(requiredDecorator.getImage());
    this.password.setLayoutData(this.passwordLData);
    this.password.addKeyListener(paramKeyListener);
    if (this.userid.getText().length() > 0)
      this.password.forceFocus();
  }
View Full Code Here


  private void setupUserIDText(Composite paramComposite, KeyListener paramKeyListener) {
    this.userNameLData.width = 176;
    this.userNameLData.height = 19;
    this.userNameLData.top = new FormAttachment(0, 1000, getDistanceFromTop());
    this.userid = new Text(paramComposite, 2048);
    ControlDecoration localControlDecoration = new ControlDecoration(this.userid, 131200);
    localControlDecoration.setDescriptionText(requiredDecorator.getDescription());
    localControlDecoration.setImage(requiredDecorator.getImage());
    this.userid.setLayoutData(this.userNameLData);
    this.userid.setDragDetect(false);
    this.userid.addKeyListener(paramKeyListener);
  }
View Full Code Here

        fControlDecoration= null;
      }
     
    } else {
      if (fControlDecoration == null) {
        fControlDecoration= new ControlDecoration(getControl(), (SWT.TOP | SWT.LEFT));
        getControl().addDisposeListener(new DisposeListener() {
          public void widgetDisposed(DisposeEvent e) {
            if (fCueLabelProvider != null) {
              fCueLabelProvider.dispose();
              fCueLabelProvider= null;
View Full Code Here

    addRuleModificationListeners();
  }

  private void addRuleModificationListeners() {
    final ControlDecoration badSeperatorNotification = new ControlDecoration(seperatorToken, SWT.RIGHT | SWT.TOP);
    badSeperatorNotification.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEC_FIELD_ERROR));
    badSeperatorNotification.hide();
    final ControlDecoration badStartFromNotification = new ControlDecoration(startFrom, SWT.RIGHT | SWT.TOP);
    badStartFromNotification.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEC_FIELD_ERROR));
    badStartFromNotification.hide();
    badStartFromNotification.setDescriptionText("Start from must be numeric");

    ModifyListener numDigitsListener = new ModifyListener() {
      @Override
      public void modifyText(ModifyEvent e) {
        inputRule.setDigitsDisplayed(numDigitsSpinner.getSelection());
        fireRuleChanged(inputRule);
      }
    };
    numDigitsSpinner.addModifyListener(numDigitsListener);
    // TODO: Add support for starting from RomanNumeralValues or
    // Alphabetical values
    ModifyListener startFromModifiedListener = new ModifyListener() {
      @Override
      public void modifyText(ModifyEvent e) {
        boolean isGood = true;
        try {
          Integer.parseInt(startFrom.getText());
        } catch (NumberFormatException f) {
          isGood = false;
        }
        if (isGood) {
          badStartFromNotification.hide();
          inputRule.setStartFrom(Integer.parseInt(startFrom.getText()));
          fireRuleChanged(inputRule);
        } else {
          badStartFromNotification.show();
        }
      }
    };
    startFrom.addModifyListener(startFromModifiedListener);
    VerifyListener seperatorTokenVerifyListener = new VerifyListener() {
View Full Code Here

          browserContentProvider.removeFilter(renamer.changingFileFilter);
        }
        browserTableViewer.refresh(true);
      }
    });
    final ControlDecoration lessThanZeroListNotification = new ControlDecoration(applyButton, SWT.RIGHT | SWT.TOP);
    lessThanZeroListNotification.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEC_FIELD_ERROR));
    lessThanZeroListNotification.hide();

    final ControlDecoration namingConflictNotification = new ControlDecoration(applyButton, SWT.RIGHT | SWT.TOP);
    namingConflictNotification
        .setDescriptionText("One or more files would have been renamed to the same thing. \nModify your inputs to avoid this happening again.");
    namingConflictNotification.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEC_FIELD_ERROR));
    namingConflictNotification.hide();

    final ControlDecoration badRegexNotification = new ControlDecoration(applyButton, SWT.RIGHT | SWT.TOP);
    badRegexNotification.setDescriptionText("The regular expression you entered is invalid. Please edit it and try again");
    badRegexNotification.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEC_FIELD_ERROR));
    badRegexNotification.hide();

    final ControlDecoration ioExceptionNotification = new ControlDecoration(applyButton, SWT.RIGHT | SWT.TOP);
    final String ioExceptionString = "An I/O Error occurred during renaming.";

    ioExceptionNotification.setDescriptionText(ioExceptionString);
    ioExceptionNotification.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEC_FIELD_WARNING));
    ioExceptionNotification.hide();

    renamer.addEventListener(new EventListener() {

      @Override
      public void seeEvent(EventType eventType, File file, RenamerRule rule) {
        switch (eventType) {
        case BadRegex:
          badRegexNotification.show();
          applyButton.setEnabled(false);
          break;
        case IOException:
          ioExceptionNotification.setDescriptionText(ioExceptionString);
          ioExceptionNotification.show();
          break;
        case CouldNotRename:
          ioExceptionNotification.setDescriptionText("Could not rename <" + file.getName() + ">");
          ioExceptionNotification.show();
          break;
        case NameConflict:
          namingConflictNotification.show();
          applyButton.setEnabled(false);
          break;
        case RenamedWithNoProblems:
          namingConflictNotification.hide();
          ioExceptionNotification.hide();
          badRegexNotification.hide();
          lessThanZeroListNotification.hide();
          applyButton.setEnabled(true);
          break;
        case LessThanOneRomanList:
View Full Code Here

                {
                    add( availableObjectClassesViewer.getSelection() );
                }
            }
        } );
        ControlDecoration availableObjectClassesInstantSearchDecoration = new ControlDecoration(
            availableObjectClassesInstantSearch, SWT.TOP | SWT.LEFT, composite );
        availableObjectClassesInstantSearchDecoration.setDescriptionText( Messages
            .getString( "NewEntryObjectclassWizardPage.FilterDescription" ) ); //$NON-NLS-1$
        availableObjectClassesInstantSearchDecoration.setImage( FieldDecorationRegistry.getDefault()
            .getFieldDecoration( FieldDecorationRegistry.DEC_CONTENT_PROPOSAL ).getImage() );
        Button reloadButton = new Button( availableObjectClassesInstantSearchComposite, SWT.PUSH | SWT.FLAT );
        reloadButton.setToolTipText( Messages.getString( "NewEntryObjectclassWizardPage.ReloadSchema" ) ); //$NON-NLS-1$
        reloadButton.setImage( BrowserCommonActivator.getDefault().getImage( BrowserCommonConstants.IMG_REFRESH ) );
        reloadButton.addSelectionListener( new SelectionAdapter()
View Full Code Here

   * @param control the control to decorate
   * @param message the message to show
   * @return the decorator
   */
  public static ControlDecoration createErrorDecorator(Control control, String message) {
    ControlDecoration controlDecoration = new ControlDecoration(control,
        SWT.RIGHT | SWT.TOP);
    controlDecoration.setDescriptionText(message);
    FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault()
        .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
    controlDecoration.setImage(fieldDecoration.getImage());
    controlDecoration.hide();
    return controlDecoration;
  }
View Full Code Here

   * @param control the control to decorate
   * @param message the message to show
   * @return the decorator
   */
  public static ControlDecoration createContentProposalDecorator(Control control, String message) {
    ControlDecoration controlDecoration = new ControlDecoration(control,
        SWT.LEFT | SWT.TOP);
    controlDecoration.setDescriptionText(message);
    FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault()
        .getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
    controlDecoration.setImage(fieldDecoration.getImage());
    controlDecoration.setShowOnlyOnFocus(false);
    return controlDecoration;
  }
View Full Code Here

 
  private void createTypeEntry(Composite client, FormToolkit toolkit) {
    typeEntry = new FormEntry(client, toolkit, "Type", null, false);
    typeEntry.setValue(composerPackage.getType(), true);
   
    ControlDecoration decoration = new ControlDecoration(typeEntry.getText(), SWT.TOP | SWT.LEFT);
   
        FieldDecoration indicator = FieldDecorationRegistry.getDefault().
                getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);

        decoration.setImage(indicator.getImage());
        decoration.setDescriptionText(indicator.getDescription() + "(Ctrl+Space)");
        decoration.setShowOnlyOnFocus(true);
   
    new AutoCompleteField(typeEntry.getText(), new TextContentAdapter(), ComposerConstants.TYPES);
   
   
    typeEntry.addFormEntryListener(new FormEntryAdapter() {
View Full Code Here

  }
 
  private void createLicenseEntry(Composite client, FormToolkit toolkit) {
    licenseEntry = new FormEntry(client, toolkit, "License", null, false);
   
    ControlDecoration decoration = new ControlDecoration(licenseEntry.getText(), SWT.TOP | SWT.LEFT);
   
        FieldDecoration indicator = FieldDecorationRegistry.getDefault().
                getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);

        decoration.setImage(indicator.getImage());
        decoration.setDescriptionText(indicator.getDescription() + "(Ctrl+Space)");
        decoration.setShowOnlyOnFocus(true);
   
    new AutoCompleteField(licenseEntry.getText(), new LicenseContentAdapter(), ComposerConstants.LICENSES);
   
    final License2StringConverter converter = new License2StringConverter();
    licenseEntry.setValue(converter.convert(composerPackage.getLicense()), true);
View Full Code Here

TOP

Related Classes of org.eclipse.jface.fieldassist.ControlDecoration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.