Package org.eclipse.jface.fieldassist

Examples of org.eclipse.jface.fieldassist.ContentProposalAdapter


        return resultList.toArray(new IContentProposal[resultList
            .size()]);
      }
    };

    ContentProposalAdapter adapter = new ContentProposalAdapter(textField,
        new TextContentAdapter(), cp, stroke, null);
    // set the acceptance style to always replace the complete content
    adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
  }
View Full Code Here


        return resultList.toArray(new IContentProposal[resultList
            .size()]);
      }
    };

    ContentProposalAdapter adapter = new ContentProposalAdapter(textField,
        new TextContentAdapter(), cp, stroke,
        VALUE_HELP_ACTIVATIONCHARS);
    // set the acceptance style to always replace the complete content
    adapter
        .setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);

    return new IPreviousValueProposalHandler() {
      public void updateProposals() {
        String value = textField.getText();
View Full Code Here

        return resultList.toArray(new IContentProposal[resultList
            .size()]);
      }
    };

    ContentProposalAdapter adapter = new ContentProposalAdapter(textField,
        new TextContentAdapter(), cp, stroke,
        UIUtils.VALUE_HELP_ACTIVATIONCHARS);
    // set the acceptance style to always replace the complete content
    adapter
        .setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
  }
View Full Code Here

        return super.getProposals(contents, position);
      }
    };
    proposalProvider.setFiltering(true);
    final ContentProposalAdapter adapter = new ContentProposalAdapter(control, contentAdapter, proposalProvider, activationKey, null);
    adapter.setPropagateKeys(true);
    adapter.setAutoActivationDelay(1500);
    adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_INSERT);

    /* Apply Proposals */
    if (values != null)
      applyAutoCompleteProposals(values, proposalProvider, adapter, autoActivate);

    /*
     * TODO: This is a hack but there doesnt seem to be any API to set the size
     * of the popup to match the actual size of the Text widget being used.
     */
    control.getDisplay().timerExec(100, new Runnable() {
      public void run() {
        if (!control.isDisposed()) {
          adapter.setPopupSize(new Point(control.getSize().x, 120));
        }
      }
    });

    return Pair.create(proposalProvider, adapter);
View Full Code Here

      InstaSearchPlugin.log(e);
    }
   
    char[] autoActivationCharacters = new char[]{':', ','};
   
    ContentProposalAdapter adapter = new SearchContentProposalAdapter(
        searchText, new StyledTextContentAdapter(),
        provider, keyStroke, autoActivationCharacters );
   
    adapter.setPopupSize(new Point(300, 150));
    adapter.setPropagateKeys(true);
    adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
  }
View Full Code Here


  public void configure(final Text text) {
    try {
      KeyStroke ks = KeyStroke.getInstance(KEY_PRESS);
      ContentProposalAdapter adapter = new ContentProposalAdapter(text,
          new TextContentAdapter(), this, ks, null);
      adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_INSERT);
    } catch (ParseException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

        attributeTypeCombo = ( Combo ) attributeTypeComboField.getControl();
        attributeTypeCombo.setItems( possibleAttributeTypes );
        attributeTypeCombo.setText( parsedAttributeType );

        // content proposal adapter
        attributeTypeCPA = new ContentProposalAdapter (attributeTypeCombo, new ComboContentAdapter(),
            new ListContentProposalProvider( attributeTypeCombo.getItems() ), null, null );
        attributeTypeCPA.setFilterStyle( ContentProposalAdapter.FILTER_NONE );
        attributeTypeCPA.setProposalAcceptanceStyle( ContentProposalAdapter.PROPOSAL_REPLACE )

        BaseWidgetUtils.createSpacer( composite, 1 );
View Full Code Here

        GridData gd = new GridData();
        gd.widthHint = 180;
        rdnLine.rdnNameComboField.getLayoutControl().setLayoutData( gd );
        rdnLine.rdnNameCombo = ( Combo ) rdnLine.rdnNameComboField.getControl();

        rdnLine.rdnNameCPA = new ContentProposalAdapter( rdnLine.rdnNameCombo, new ComboContentAdapter(),
            new ListContentProposalProvider( attributeNames ), null, null );
        rdnLine.rdnNameCPA.setFilterStyle( ContentProposalAdapter.FILTER_NONE );
        rdnLine.rdnNameCPA.setProposalAcceptanceStyle( ContentProposalAdapter.PROPOSAL_REPLACE );

        rdnLine.rdnEqualsLabel = new Label( rdnComposite, SWT.NONE );
View Full Code Here

        modSpec.modAttributeCombo = ( Combo ) modSpec.modAttributeComboField.getControl();
        modSpec.modAttributeCombo.setItems( attributeDescriptions );
        modSpec.modAttributeCombo.addModifyListener( this );

        // content proposal adapter
        modSpec.modAttributeCPA = new ContentProposalAdapter( modSpec.modAttributeCombo, new ComboContentAdapter(),
            new ListContentProposalProvider( attributeDescriptions ), null, null );
        modSpec.modAttributeCPA.setFilterStyle( ContentProposalAdapter.FILTER_NONE );
        modSpec.modAttributeCPA.setProposalAcceptanceStyle( ContentProposalAdapter.PROPOSAL_REPLACE );

        // add button with listener
View Full Code Here

            KeyStroke keyStroke = KeyStroke.getInstance("Ctrl+Space");
            provider = new SimpleContentProposalProvider(new String[]{});
            provider.setFiltering(true);

            contentProposalAdapter = new ContentProposalAdapter(parentTemplate, new ViewpathProposalAdapter(),
                    provider, keyStroke, null);

            contentProposalAdapter.setFilterStyle(ContentProposalAdapter.FILTER_CHARACTER);
            contentProposalAdapter.setAutoActivationDelay(10);
            contentProposalAdapter.setPropagateKeys(true);
View Full Code Here

TOP

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

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.