Package org.eclipse.jface.text.contentassist

Examples of org.eclipse.jface.text.contentassist.ICompletionProposal.apply()


        IContentProposal[] proposals = new IContentProposal[oldProposals.length];
        for ( int i = 0; i < oldProposals.length; i++ )
        {
            final ICompletionProposal oldProposal = oldProposals[i];
            final Document document = new Document( contents );
            oldProposal.apply( document );

            proposals[i] = new IContentProposal()
            {
                public String getContent()
                {
View Full Code Here


        IContentProposal[] proposals = new IContentProposal[oldProposals.length];
        for ( int i = 0; i < oldProposals.length; i++ )
        {
            final ICompletionProposal oldProposal = oldProposals[i];
            final Document document = new Document( contents );
            oldProposal.apply( document );

            proposals[i] = new IContentProposal()
            {
                public String getContent()
                {
View Full Code Here

        IContentProposal[] proposals = new IContentProposal[oldProposals.length];
        for ( int i = 0; i < oldProposals.length; i++ )
        {
            final ICompletionProposal oldProposal = oldProposals[i];
            final Document document = new Document( contents );
            oldProposal.apply( document );

            proposals[i] = new IContentProposal()
            {
                public String getContent()
                {
View Full Code Here

        IContentProposal[] proposals = new IContentProposal[oldProposals.length];
        for ( int i = 0; i < oldProposals.length; i++ )
        {
            final ICompletionProposal oldProposal = oldProposals[i];
            final Document document = new Document( contents );
            oldProposal.apply( document );

            proposals[i] = new IContentProposal()
            {
                public String getContent()
                {
View Full Code Here

        IContentProposal[] proposals = new IContentProposal[oldProposals.length];
        for ( int i = 0; i < oldProposals.length; i++ )
        {
            final ICompletionProposal oldProposal = oldProposals[i];
            final Document document = new Document( contents );
            oldProposal.apply( document );

            proposals[i] = new IContentProposal()
            {
                public String getContent()
                {
View Full Code Here

            if (proposal != null) {
                if (proposal instanceof ICompletionProposalExtension2) {
                    ICompletionProposalExtension2 extension2 = (ICompletionProposalExtension2) proposal;
                    extension2.apply(targetEditor.getPySourceViewer(), '\n', 0, 0);
                } else {
                    proposal.apply(refactoringInfo.getDocument());
                }
            }

        } catch (Exception e) {
            Log.log(e);
View Full Code Here

                "new_method = assist._NewMethod(a = 1, b = 2)";

        assertEquals(expected, doc.get());

        doc = new Document(d);
        prop1.apply(doc);

        expected = "" +
                "from testAssist import assist\n" +
                "self._new_method = assist._NewMethod(a = 1, b = 2)";
        assertEquals(expected, doc.get());
View Full Code Here

        IPyCalltipsContextInformation contextInformation = (IPyCalltipsContextInformation) prop.getContextInformation();
        assertEquals("self, a, b", contextInformation.getContextDisplayString());
        assertEquals("self, a, b", contextInformation.getInformationDisplayString());

        Document doc = new Document(s);
        prop.apply(doc);
        String expected = com.aptana.shared_core.string.StringUtils.format(original, "a, b");
        assertEquals(expected, doc.get());
    }

    public void testRegularClass() throws Exception {
View Full Code Here

        //
        //To implement that, when we see that it is called inside some parenthesis, we should create a subclass of
        //PyCompletionProposal that will have its apply method overriden, so that nothing happens here (the calltips will
        //still be shown)
        Document doc = new Document();
        prop.apply(doc);
        assertEquals("", doc.get());
    }

    public void testCalltips2() throws Exception {
        String s;
View Full Code Here

    // Get the XML document model
    IStructuredModel model = null;
    try {
      model = XmlQuickFixUtil.getModel(marker);
      // Execute Quick Fix
      newMethodCompletionProposal.apply(model.getStructuredDocument());
    }
    catch (CoreException e) {
      StatusHandler.log(e.getStatus());
      MessageDialog.openError(Display.getDefault().getActiveShell(), "Quick Fix Error",
          "Could not find error marker");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.