Package org.eclipse.jface.fieldassist

Examples of org.eclipse.jface.fieldassist.TextContentAdapter


    superClassField.setLabelText("&Superclass:");
    superClassField.setButtonLabel("Brows&e...");
    superClassField.doFillIntoGrid(container, nColumns);

    PHPContentProposalAdapter contentProposalAdapter = new PHPContentProposalAdapter(
        superClassField.getTextControl(), new TextContentAdapter(), new PHPContentProposalProvider(
            getScriptFolder().getScriptProject()), null, null);

    contentProposalAdapter.addContentProposalListener(new IContentProposalListener() {
      @Override
      public void proposalAccepted(IContentProposal proposal) {
View Full Code Here


        gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
        gridData.widthHint= 0;
        gridData.heightHint= SWT.DEFAULT;
        gridData.horizontalSpan= 1;
        txtGroup.setLayoutData(gridData);
        txtGroupCompleteField = new AutoCompleteField(txtGroup, new TextContentAdapter(), new String[] {});
        txtGroupCompleteField.setProposals( reviewGroupNameList.toArray(new String[reviewGroupNameList.size()]) );
        txtGroup.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                List<String> proposalTmp = getNewListForProposal( reviewGroupNameList, txtGroup.getText() );
                txtGroupCompleteField.setProposals( proposalTmp.toArray(new String[proposalTmp.size()]) );
            }
        });
       
        Label lblBranch = new Label(groupAttribute, SWT.NONE);
        lblBranch.setText(RbSubclipseMessages.getString("PAGE_BRANCHES"));
        textBranch = new Text(groupAttribute, SWT.BORDER);
        gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
        gridData.widthHint= 0;
        gridData.heightHint= SWT.DEFAULT;
        gridData.horizontalSpan= 1;
        textBranch.setLayoutData(gridData);
        textBranch.setEnabled(false);
       
        Label lblPeople = new Label(groupAttribute, SWT.NONE);
        lblPeople.setText(RbSubclipseMessages.getString("PAGE_REVIEWPEOPLES"));
        txtPeople = new Text(groupAttribute, SWT.BORDER);
        gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
        gridData.widthHint= 0;
        gridData.heightHint= SWT.DEFAULT;
        gridData.horizontalSpan= 1;
        txtPeople.setLayoutData(gridData);
        txtPeopleCompleteField = new AutoCompleteField(txtPeople, new TextContentAdapter(), new String[] {});
        txtPeopleCompleteField.setProposals( userNameList.toArray(new String[userNameList.size()]) );
        txtPeople.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                List<String> proposalTmp = getNewListForProposal( userNameList, txtPeople.getText() );
                txtPeopleCompleteField.setProposals( proposalTmp.toArray(new String[proposalTmp.size()]) );
View Full Code Here

        }
       
        text.setEditable( !isReadOnly );
       
        proposalProvider = new FunctionContentProposalProvider(false);
        TextContentAdapter contentAdapter = new TextContentAdapter();
       
        ContentProposalAdapter adapter = new ContentProposalAdapter(text, contentAdapter,
                proposalProvider, null, null);

        // Need to set adapter to replace existing text. Default is insert.
View Full Code Here

        FunctionFinder ff = new FunctionFinder(null);

        proposalProvider = new FunctionContentProposalProvider();
        proposalProvider.setFiltering(true);
        ContentProposalAdapter adapter = new ContentProposalAdapter(
                text, new TextContentAdapter(),
                proposalProvider,
                null, null);
       
        //Need to set adapter to replace existing text. Default is insert.
        adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
View Full Code Here

        text = new Text(parent, style);
        feedback = new ControlDecoration(text, SWT.TOP | SWT.LEFT);

        proposalProvider = new FunctionContentProposalProvider();
        proposalProvider.setFiltering(true);
        ContentProposalAdapter adapter = new ContentProposalAdapter(text, new TextContentAdapter(),
                proposalProvider, null, null);
       
        //Need to set adapter to replace existing text. Default is insert.
        adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
       
View Full Code Here

            text = new Text(parent, SWT.SINGLE | SWT.BORDER);
            setPreferredTextSize(30,1 );
        }

        proposalProvider = new FunctionContentProposalProvider();
        TextContentAdapter contentAdapter = new TextContentAdapter();
       
        ContentProposalAdapter adapter = new ContentProposalAdapter(text, contentAdapter,
                proposalProvider, null, null);

        // Need to set adapter to replace existing text. Default is insert.
View Full Code Here

      }
    });

    ClickUtils.createLabel(classGroup, ClickPlugin.getString("wizard.newPage.pageClassGroup.package"));
    ContentAssistField packageField = new ContentAssistField(classGroup, SWT.BORDER,
        new TextControlCreator(), new TextContentAdapter(), packageAssistProvider,
        ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, new char[0]);
    packageName = (Text)packageField.getControl();
    packageField.getLayoutControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    if(selection instanceof IPackageFragment){
      packageName.setText(((IPackageFragment)selection).getElementName());
    } else if(initPackage!=null && initPackage.length()!=0){
      packageName.setText(initPackage);
    } else if(getProject()!=null){
      String pagesPackage = ClickUtils.getPagePackageName(getProject());
      if(pagesPackage != null){
        packageName.setText(pagesPackage);
      }
    }
    packageName.addModifyListener(new ModifyListener(){
      public void modifyText(ModifyEvent e){
        validate();
      }
    });

    browsePackage = new Button(classGroup, SWT.PUSH);
    browsePackage.setText(ClickPlugin.getString("action.browse"));
    browsePackage.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(SelectionEvent evt){
        IRunnableContext context= new BusyIndicatorRunnableContext();
        int style = PackageSelectionDialog.F_REMOVE_DUPLICATES |
                    PackageSelectionDialog.F_SHOW_PARENTS |
                    PackageSelectionDialog.F_HIDE_DEFAULT_PACKAGE;

        JavaSearchScope scope = new JavaSearchScope();
        try {
          IJavaProject project = JavaCore.create(getProject());
          scope.add((JavaProject)project, JavaSearchScope.SOURCES, new HashSet<Integer>(2, 1));
        } catch(Exception ex){
          ClickPlugin.log(ex);
        }

        PackageSelectionDialog dialog = new PackageSelectionDialog(getShell(), context, style, scope);
        dialog.setMultipleSelection(false);
        if(dialog.open()==PackageSelectionDialog.OK){
          Object[] result = dialog.getResult();
          if(result.length >= 1){
            IPackageFragment fragment = (IPackageFragment)result[0];
            packageName.setText(fragment.getElementName());
          }
        }
      }
    });

    ClickUtils.createLabel(classGroup, ClickPlugin.getString("wizard.newPage.pageClassGroup.classname"));
    Composite classField = FieldAssistUtils.createNullDecoratedPanel(classGroup, false);
    className = new Text(classField, SWT.BORDER);
    classField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    className.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if(initClassName!=null){
      className.setText(initClassName);
    }
    className.addModifyListener(new ModifyListener(){
      public void modifyText(ModifyEvent e){
        validate();
      }
    });

    ClickUtils.createLabel(classGroup, "");

    ClickUtils.createLabel(classGroup, ClickPlugin.getString("wizard.newPage.pageClassGroup.superclass"));
    ContentAssistField superClassField = new ContentAssistField(classGroup, SWT.BORDER,
        new TextControlCreator(), new TextContentAdapter(), typeAssistProvider,
        ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, new char[0]);
    superClass = (Text)superClassField.getControl();
    superClassField.getLayoutControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    superClass.setText(settings.get(NewClickPageWizard.SUPERCLASS));
    superClass.addModifyListener(new ModifyListener(){
View Full Code Here

    Composite composite = toolkit.createComposite(parent);
    composite.setLayout(FieldAssistUtils.createGridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    ContentAssistField field = new ContentAssistField(composite, SWT.BORDER,
        new TextControlCreator(), new TextContentAdapter(),
        new TypeNameContentProposalProvider(project),
        ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS,
        new char[0]);

    final Text text = (Text)field.getControl();
View Full Code Here

          // ma.setText("...");

        }
      });
      cText = "";
      IControlContentAdapter controlContentAdapter = new TextContentAdapter();
      IContentProposalProvider proposalProvider = new IContentProposalProvider() {

        public IContentProposal[] getProposals(String contents,
            int position) {
          contents = contents.trim();
View Full Code Here

 
  public AutocompleteText(Text text, String[] selectionItems) {
    if (text == nullreturn;
    this.text = text;
    provider = getContentProposalProvider(selectionItems);
    adapter = new ContentProposalAdapter(text, new TextContentAdapter(), provider, getActivationKeystroke(), getAutoactivationChars());
    adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
  }
View Full Code Here

TOP

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

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.