Package org.eclipse.jface.fieldassist

Examples of org.eclipse.jface.fieldassist.SimpleContentProposalProvider


    /* Auto-Activate on Key-Down */
    KeyStroke activationKey = KeyStroke.getInstance(SWT.ARROW_DOWN);

    /* Create Content Proposal Adapter */
    SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(new String[0]) {
      @Override
      public IContentProposal[] getProposals(String contents, int position) {
        if (Display.getCurrent() != null && !control.isVisible())
          return new IContentProposal[0];

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

View Full Code Here


    /* Auto-Activate on Key-Down */
    KeyStroke activationKey = KeyStroke.getInstance(SWT.ARROW_DOWN);

    /* Create Content Proposal Adapter */
    SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(new String[0]);
    proposalProvider.setFiltering(true);
    final ContentProposalAdapter adapter = new ContentProposalAdapter(text, new TextContentAdapter(), proposalProvider, activationKey, null);
    adapter.setPropagateKeys(true);
    adapter.setAutoActivationDelay(500);
    adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);

View Full Code Here

    /* Auto-Activate on Key-Down */
    KeyStroke activationKey = KeyStroke.getInstance(SWT.ARROW_DOWN);

    /* Create Content Proposal Adapter */
    SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(new String[0]);
    proposalProvider.setFiltering(true);
    final ContentProposalAdapter adapter = new ContentProposalAdapter(text, new TextContentAdapter(), proposalProvider, activationKey, null);
    adapter.setPropagateKeys(true);
    adapter.setAutoActivationDelay(500);
    adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);

View Full Code Here

                        if (ntManager == null) {
                            return text;
                        }
                        try {
                            Collection<String> types = ntManager.getAllowedPrimaryChildNodeTypes(getNode().getParent().getPrimaryType());
                            SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(types.toArray(new String[0]));
                            proposalProvider.setFiltering(true);
                            ContentProposalAdapter adapter = new ContentProposalAdapter(text, new TextContentAdapter(),
                                    proposalProvider, null, null);
                            adapter.setPropagateKeys(true);
                            adapter
                                    .setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
View Full Code Here

        if (proposals != null) {
          try {
            String[] props = new String[Math.min(maxProposals, getProposals().size())];
            props = getProposals().subList(0, props.length).toArray(props);
           
            SimpleContentProposalProvider provider = new SimpleContentProposalProvider(props);
            provider.setFiltering(true);
           
            ContentProposalAdapter adapter = new ContentProposalAdapter(text,
                new TextContentAdapter(),
                provider,
                KeyStroke.getInstance("ARROW_DOWN"), null);
View Full Code Here

                validateInput();
            }
           
        });

        SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(combo.getItems());
        proposalProvider.setFiltering(true);
        final ComboContentAdapter controlContentAdapter = new ComboContentAdapter() {
            @Override
            public void insertControlContents(Control control, String text,
                    int cursorPosition) {
                Point selection = combo.getSelection();
View Full Code Here

                if (keys.length > 0) {
                    combo.select(0);
                    handleKeySelected(keys[0]);
                }
                // Auto completion
                SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(keys);
                proposalProvider.setFiltering(true);
                ContentProposalAdapter adapter = new ContentProposalAdapter(combo, new ComboContentAdapter(),
                        proposalProvider, null, null);
                adapter.setPropagateKeys(true);
                adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
                adapter.addContentProposalListener(new IContentProposalListener() {
View Full Code Here

            Messages.Log4JPatternLayoutWizardPage_dec_contentAssistAvailable);
       
        KeyStroke keyStroke = KeyStroke.getInstance("Ctrl+Space"); //$NON-NLS-1$
        ContentProposalAdapter adapter = new ContentProposalAdapter(patternText,
            new TextContentAdapter(),
            new SimpleContentProposalProvider(patterns.toArray(new String[patterns.size()])),
            keyStroke, null);
        adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
      }
    } catch (Exception e) {
      // Log and show error
View Full Code Here

    /* Auto-Activate on Key-Down */
    KeyStroke activationKey = KeyStroke.getInstance(SWT.ARROW_DOWN);

    /* Create Content Proposal Adapter */
    SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(new String[0]) {
      @Override
      public IContentProposal[] getProposals(String contents, int position) {
        if (Display.getCurrent() != null && !control.isVisible())
          return new IContentProposal[0];

        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);

View Full Code Here

    private void setupAutocomplete()
    {
        try {

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

            contentProposalAdapter = new ContentProposalAdapter(parentTemplate, new ViewpathProposalAdapter(),
                    provider, keyStroke, null);
View Full Code Here

TOP

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

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.