Java 类org.eclipse.jface.text.IInformationControl 实例源码

项目:solidity-ide    文件:CustomCSSHelpHoverProvider.java   
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString = EditorsUI
            .getTooltipAffordanceString();
    if (BrowserInformationControl.isAvailable(parent)) {
        String font = "org.eclipse.jdt.ui.javadocfont";
        BrowserInformationControl iControl = new BrowserInformationControl(
                parent, font, false) {
            @Override
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        addLinkListener(iControl);
        return iControl;
    } else {
        return new DefaultInformationControl(parent,
                tooltipAffordanceString);
    }
}
项目:egradle    文件:SimpleBrowserInformationControl.java   
@Override
public IInformationControlCreator getInformationPresenterControlCreator() {
    /*
     * Its necessary to implement this - otherwise leaving the origin
     * tooltip area, which does not contain the browser control, will hide
     * the control. It would be nicer if eclipse would have an easier
     * mechanism to reuse the origin control!
     */
    return new IInformationControlCreator() {
        @Override
        public IInformationControl createInformationControl(Shell parent) {
            SimpleBrowserInformationControl newControl = new SimpleBrowserInformationControl(parent, 20);
            newControl.setBrowserEGradleLinkListener(browserEGradleLinkListener);
            return newControl;
        }
    };
}
项目:overviewruler    文件:OpenHandler.java   
private void showQuickAnnotations(final JavaEditor editor) {
  InformationPresenter presenter = new InformationPresenter(new IInformationControlCreator() {
    public IInformationControl createInformationControl(Shell parent) {
      int shellStyle = SWT.RESIZE;
      int treeStyle = SWT.V_SCROLL | SWT.H_SCROLL;
      return new QuickAnnotationInformationControl(parent, shellStyle, treeStyle, editor);
    }
  });

  IInformationProvider provider = new JavaElementProvider(editor, false);
  presenter.setInformationProvider(provider, IDocument.DEFAULT_CONTENT_TYPE);

  presenter.install(editor.getViewer());
  presenter.install(editor.getViewer().getTextWidget());
  presenter.showInformation();
}
项目:typescript.java    文件:HoverControlCreator.java   
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString = "Press F2 for focus";
    if (BrowserInformationControl.isAvailable(parent)) {
        String font = JFaceResources.DIALOG_FONT;
        BrowserInformationControl iControl = new BrowserInformationControl(
                parent, font, tooltipAffordanceString) {
            /*
             * @see org.eclipse.jface.text.IInformationControlExtension5#
             * getInformationPresenterControlCreator()
             */
            @Override
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        addLinkListener(iControl);
        return iControl;
    } else {
        return new DefaultInformationControl(parent,
                tooltipAffordanceString);
    }
}
项目:typescript.java    文件:JavaScriptLightWeightEditor.java   
/**
 * Install everything necessary to get document folding working and enable
 * document folding
 * 
 * @param sourceViewer
 */
private void installProjectionSupport() {

    ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();
    fProjectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors());
    fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error"); //$NON-NLS-1$
    fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning"); //$NON-NLS-1$
    fProjectionSupport.setHoverControlCreator(new IInformationControlCreator() {
        public IInformationControl createInformationControl(Shell parent) {
            return new DefaultInformationControl(parent);
        }
    });
    fProjectionSupport.install();

    if (isFoldingEnabled()) {
        projectionViewer.doOperation(ProjectionViewer.TOGGLE);
    }
}
项目:bts    文件:DefaultEObjectHoverProvider.java   
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString = ""; //"Press 'F2' for focus";//EditorsUI.getTooltipAffordanceString();
    if (BrowserInformationControl.isAvailable(parent)) {
        String font = "org.eclipse.jdt.ui.javadocfont"; // FIXME: PreferenceConstants.APPEARANCE_JAVADOC_FONT;
        IXtextBrowserInformationControl iControl = new XtextBrowserInformationControl(parent, font,
                tooltipAffordanceString) {
            /*
             * @see org.eclipse.jface.text.IInformationControlExtension5#getInformationPresenterControlCreator()
             */
            @Override
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        addLinkListener(iControl);
        return iControl;
    } else {
        return new DefaultInformationControl(parent, tooltipAffordanceString);
    }
}
项目:statecharts    文件:CustomCSSHelpHoverProvider.java   
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString = EditorsUI
            .getTooltipAffordanceString();
    if (BrowserInformationControl.isAvailable(parent)) {
        String font = "org.eclipse.jdt.ui.javadocfont";
        BrowserInformationControl iControl = new BrowserInformationControl(
                parent, font, false) {
            @Override
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        addLinkListener(iControl);
        return iControl;
    } else {
        return new DefaultInformationControl(parent,
                tooltipAffordanceString);
    }
}
项目:brainfuck    文件:BfSourceViewerConfiguration.java   
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
    ContentAssistant assistant = new ContentAssistant();
    assistant.setDocumentPartitioning(this.getConfiguredDocumentPartitioning(sourceViewer));
    CompletionProposalToggler toggler = new CompletionProposalToggler();
    assistant.setContentAssistProcessor(toggler, IDocument.DEFAULT_CONTENT_TYPE);
    assistant.setContentAssistProcessor(toggler, EditorConstants.PARTITION_TYPE_BRAINFUCK_CODE);
    assistant.addCompletionListener(toggler);       
    assistant.setStatusLineVisible(true);
    assistant.setRepeatedInvocationMode(true);
    assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
    assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
    assistant.setAutoActivationDelay(500);
    assistant.enableAutoActivation(false);

    assistant.setInformationControlCreator(new AbstractReusableInformationControlCreator() {

        @Override
        protected IInformationControl doCreateInformationControl(Shell parent) {
            return new DefaultInformationControl(parent);
        }
    });
    assistant.setContentAssistProcessor(null, EditorConstants.PARTITION_TYPE_MULTILINE_COMMENT);
    return assistant;
}
项目:gama    文件:GamlHoverProvider.java   
@Override
public IInformationControl doCreateInformationControl(final Shell parent) {

    final String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
    if (BrowserInformationControl.isAvailable(parent)) {
        final String font = "org.eclipse.jdt.ui.javadocfont"; // FIXME:
                                                                // PreferenceConstants.APPEARANCE_JAVADOC_FONT;
        final IXtextBrowserInformationControl iControl =
                new GamlInformationControl(parent, font, tooltipAffordanceString) {

                };
        addLinkListener(iControl);
        return iControl;
    } else {
        return new DefaultInformationControl(parent, tooltipAffordanceString);
    }
}
项目:eclipse-wtp-json    文件:JSONHoverControlCreator.java   
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString = "Press F2 for focus";
    if (BrowserInformationControl.isAvailable(parent)) {
        String font = JFaceResources.DIALOG_FONT;
        BrowserInformationControl iControl = new BrowserInformationControl(
                parent, font, tooltipAffordanceString) {
            /*
             * @see org.eclipse.jface.text.IInformationControlExtension5#
             * getInformationPresenterControlCreator()
             */
            @Override
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        // addLinkListener(iControl);
        return iControl;
    } else {
        return new DefaultInformationControl(parent,
                tooltipAffordanceString);
    }
}
项目:APICloud-Studio    文件:AbstractDocumentationHover.java   
public IInformationControl doCreateInformationControl(Shell parent)
{
    if (BrowserInformationControl.isAvailable(parent))
    {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        CustomBrowserInformationControl iControl = new CustomBrowserInformationControl(parent, null, tbm);
        iControl.setBackgroundColor(documentationHover.getBackgroundColor());
        iControl.setForegroundColor(documentationHover.getForegroundColor());
        documentationHover.populateToolbarActions(tbm, iControl);
        tbm.update(true);
        documentationHover.installLinkListener(iControl);
        return iControl;
    }
    else
    {
        return new DefaultInformationControl(parent, true);
    }
}
项目:APICloud-Studio    文件:AbstractDocumentationHover.java   
public IInformationControl doCreateInformationControl(Shell parent)
{
    if (CustomBrowserInformationControl.isAvailable(parent))
    {
        CustomBrowserInformationControl iControl = new CustomBrowserInformationControl(parent, null,
                EditorsUI.getTooltipAffordanceString())
        {
            public IInformationControlCreator getInformationPresenterControlCreator()
            {
                return informationPresenterControlCreator;
            }
        };
        iControl.setBackgroundColor(getBackgroundColor());
        iControl.setForegroundColor(getForegroundColor());
        return iControl;
    }
    else
    {
        // return new ThemedInformationControl(parent, null, EditorsUI.getTooltipAffordanceString());
        return new DefaultInformationControl(parent, true);
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:JavadocHover.java   
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString= fAdditionalInfoAffordance ? JavaPlugin.getAdditionalInfoAffordanceString() : EditorsUI.getTooltipAffordanceString();
    if (BrowserInformationControl.isAvailable(parent)) {
        String font= PreferenceConstants.APPEARANCE_JAVADOC_FONT;
        BrowserInformationControl iControl= new BrowserInformationControl(parent, font, tooltipAffordanceString) {
            /*
             * @see org.eclipse.jface.text.IInformationControlExtension5#getInformationPresenterControlCreator()
             */
            @Override
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        addLinkListener(iControl);
        return iControl;
    } else {
        return new DefaultInformationControl(parent, tooltipAffordanceString);
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:ProblemHover.java   
@Override
public void fillToolBar(ToolBarManager manager, IInformationControl infoControl) {
    super.fillToolBar(manager, infoControl);
    if (!(annotation instanceof IJavaAnnotation))
        return;

    IJavaAnnotation javaAnnotation= (IJavaAnnotation) annotation;

    String optionId= JavaCore.getOptionForConfigurableSeverity(javaAnnotation.getId());
    if (optionId != null) {
        IJavaProject javaProject= javaAnnotation.getCompilationUnit().getJavaProject();
        boolean isJavadocProblem= (javaAnnotation.getId() & IProblem.Javadoc) != 0;
        ConfigureProblemSeverityAction problemSeverityAction= new ConfigureProblemSeverityAction(javaProject, optionId, isJavadocProblem, infoControl);
        manager.add(problemSeverityAction);
    }
}
项目:eclipse-wtp-webresources    文件:WebResourcesHoverControlCreator.java   
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString = "Press F2 for focus";
    if (BrowserInformationControl.isAvailable(parent)) {
        String font = JFaceResources.DIALOG_FONT;
        BrowserInformationControl iControl = new BrowserInformationControl(
                parent, font, tooltipAffordanceString) {
            /*
             * @see org.eclipse.jface.text.IInformationControlExtension5#
             * getInformationPresenterControlCreator()
             */
            @Override
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        addLinkListener(iControl);
        return iControl;
    } else {
        return new DefaultInformationControl(parent,
                tooltipAffordanceString);
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavadocHover.java   
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString= fAdditionalInfoAffordance ? JavaPlugin.getAdditionalInfoAffordanceString() : EditorsUI.getTooltipAffordanceString();
    if (BrowserInformationControl.isAvailable(parent)) {
        String font= PreferenceConstants.APPEARANCE_JAVADOC_FONT;
        BrowserInformationControl iControl= new BrowserInformationControl(parent, font, tooltipAffordanceString) {
            /*
             * @see org.eclipse.jface.text.IInformationControlExtension5#getInformationPresenterControlCreator()
             */
            @Override
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        addLinkListener(iControl);
        return iControl;
    } else {
        return new DefaultInformationControl(parent, tooltipAffordanceString);
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ProblemHover.java   
@Override
public void fillToolBar(ToolBarManager manager, IInformationControl infoControl) {
    super.fillToolBar(manager, infoControl);
    if (!(annotation instanceof IJavaAnnotation))
        return;

    IJavaAnnotation javaAnnotation= (IJavaAnnotation) annotation;

    String optionId= JavaCore.getOptionForConfigurableSeverity(javaAnnotation.getId());
    if (optionId != null) {
        IJavaProject javaProject= javaAnnotation.getCompilationUnit().getJavaProject();
        boolean isJavadocProblem= (javaAnnotation.getId() & IProblem.Javadoc) != 0;
        ConfigureProblemSeverityAction problemSeverityAction= new ConfigureProblemSeverityAction(javaProject, optionId, isJavadocProblem, infoControl);
        manager.add(problemSeverityAction);
    }
}
项目:ant-ivyde    文件:XMLConfiguration.java   
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
    // Create content assistant
    ContentAssistant assistant = new ContentAssistant();

    // required to display additional info
    assistant.setInformationControlCreator(new IInformationControlCreator() {
        public IInformationControl createInformationControl(Shell parent) {
            return new DefaultInformationControl(parent, true);
        }
    });

    processor.setFile(file);
    // Set this processor for each supported content type
    assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_TAG);
    assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_DEFAULT);
    assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);

    // Return the content assistant
    return assistant;
}
项目:Pydev    文件:InformationPresenterHelpers.java   
@Override
public IInformationControl createInformationControl(Shell parent) {

    //            try { -- this would show the 'F2' for focus, but we don't actually handle that, so, don't use it.
    //                tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
    //            } catch (Throwable e) {
    //                //Not available on Eclipse 3.2
    //            }

    //Note: don't use the parent because when it's closed we don't want the parent to have focus (we want the original
    //widget that had focus to regain the focus).
    //            if (parent == null) {
    //                parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
    //            }

    String tooltipAffordanceString = null;
    if (this.informationPresenterControlManager != null) {
        InformationPresenterControlManager m = this.informationPresenterControlManager.get();
        if (m != null) {
            tooltipAffordanceString = m.getTooltipAffordanceString();
        }
    }
    PyInformationControl tooltip = new PyInformationControl(null, tooltipAffordanceString, presenter);
    return tooltip;
}
项目:Pydev    文件:AbstractPyEditorTextHover.java   
@Override
public IInformationControlCreator getHoverControlCreator() {
    return new IInformationControlCreator() {

        @Override
        public IInformationControl createInformationControl(Shell parent) {
            String tooltipAffordanceString = null;
            try {
                tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
            } catch (Throwable e) {
                //Not available on Eclipse 3.2
            }
            informationControl = new PyInformationControl(parent, tooltipAffordanceString,
                    informationPresenter);
            return informationControl;
        }
    };
}
项目:Pydev    文件:PyEditProjection.java   
@Override
public void createPartControl(Composite parent) {
    super.createPartControl(parent);
    try {
        ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();

        fProjectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors());
        fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error");
        fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning");
        fProjectionSupport.setHoverControlCreator(new IInformationControlCreator() {
            @Override
            public IInformationControl createInformationControl(Shell shell) {
                return new DefaultInformationControl(shell);
            }
        });
        fProjectionSupport.install();

        if (isFoldingEnabled()) {
            projectionViewer.doOperation(ProjectionViewer.TOGGLE);
        }
    } catch (Exception e) {
        Log.log(e);
    }
}
项目:goclipse    文件:ProblemHover.java   
@Override
        public void fillToolBar(ToolBarManager manager, IInformationControl infoControl) {
            super.fillToolBar(manager, infoControl);
//          if (!(annotation instanceof IJavaAnnotation))
//              return;
//
//          IJavaAnnotation javaAnnotation= (IJavaAnnotation) annotation;
//
//          String optionId= JavaCore.getOptionForConfigurableSeverity(javaAnnotation.getId());
//          if (optionId != null) {
//              IJavaProject javaProject= javaAnnotation.getCompilationUnit().getJavaProject();
//              boolean isJavadocProblem= (javaAnnotation.getId() & IProblem.Javadoc) != 0;
//              ConfigureProblemSeverityAction problemSeverityAction= new ConfigureProblemSeverityAction(javaProject, optionId, isJavadocProblem, infoControl);
//              manager.add(problemSeverityAction);
//          }
        }
项目:eclipse-bash-editor    文件:BashTextHover.java   
@Override
public IInformationControl createInformationControl(Shell parent) {
    if (ReducedBrowserInformationControl.isAvailableFor(parent)) {
        ReducedBrowserInformationControl control = new ReducedBrowserInformationControl(parent);
        return control;
    } else {
        return new DefaultInformationControl(parent, true);
    }
}
项目:eclipse-bash-editor    文件:ReducedBrowserInformationControl.java   
@Override
public IInformationControlCreator getInformationPresenterControlCreator() {
    return new IInformationControlCreator() {
        @Override
        public IInformationControl createInformationControl(Shell parent) {
            ReducedBrowserInformationControl newControl = new ReducedBrowserInformationControl(parent);
            return newControl;
        }
    };
}
项目:pgcodekeeper    文件:SQLEditorTextHover.java   
@Override
public IInformationControlCreator getHoverControlCreator() {
    return new IInformationControlCreator() {
        @Override
        public IInformationControl createInformationControl(Shell parent) {
            return new DefaultInformationControl(parent, EditorsUI.getTooltipAffordanceString());
        }
    };
}
项目:egradle    文件:GradleCompletionProposal.java   
@Override
public IInformationControl doCreateInformationControl(Shell shell) {
    if (SimpleBrowserInformationControl.isAvailableFor(shell)){
        SimpleBrowserInformationControl control = new SimpleBrowserInformationControl(shell,20);
        if (lazyBuilder!=null){
            control.setBrowserEGradleLinkListener(new DefaultEGradleLinkListener(lazyBuilder.getFgColor(), lazyBuilder.getBgColor(), lazyBuilder.getCommentColor(), lazyBuilder.getBuilder()));
        }
        return control;
    }
    return new DefaultInformationControl(shell, true);
}
项目:egradle    文件:GradleTextHover.java   
@Override
public IInformationControl createInformationControl(Shell parent) {
    if (SimpleBrowserInformationControl.isAvailableFor(parent)) {
        SimpleBrowserInformationControl control = new SimpleBrowserInformationControl(parent);
        control.setBrowserEGradleLinkListener(
                new DefaultEGradleLinkListener(fgColor, bgColor, commentColorWeb, builder));
        return control;
    } else {
        return new DefaultInformationControl(parent, true);
    }
}
项目:DarwinSPL    文件:DwprofileTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    if (de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl.isAvailable(parent)) {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl iControl = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl(parent, FONT, tbm);
        final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
        tbm.add(openDeclarationAction);
        final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();

        IInputChangedListener inputChangeListener = new IInputChangedListener() {
            public void inputChanged(Object newInput) {
                if (newInput == null) {
                    selectionProvider.setSelection(new StructuredSelection());
                } else if (newInput instanceof de.darwinspl.preferences.resource.dwprofile.ui.DwprofileDocBrowserInformationControlInput) {
                    de.darwinspl.preferences.resource.dwprofile.ui.DwprofileDocBrowserInformationControlInput input = (de.darwinspl.preferences.resource.dwprofile.ui.DwprofileDocBrowserInformationControlInput) newInput;
                    Object inputElement = input.getInputElement();
                    selectionProvider.setSelection(new StructuredSelection(inputElement));
                    // If there is an element of type EObject in the input element, the button to open
                    // the declaration will be set enable
                    boolean isEObjectInput = inputElement instanceof EObject;
                    openDeclarationAction.setEnabled(isEObjectInput);
                    if (isEObjectInput) {
                        String simpleName = inputElement.getClass().getSimpleName();
                        simpleName = simpleName.substring(0, simpleName.length() - 4);
                        openDeclarationAction.setText("Open " + simpleName);
                    } else                          openDeclarationAction.setText("Open Declaration");
                }
            }
        };
        iControl.addInputChangeListener(inputChangeListener);

        tbm.update(true);
        return iControl;
    } else {
        return new DefaultInformationControl(parent, true);
    }
}
项目:DarwinSPL    文件:DwprofileTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
    if (de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl.isAvailable(parent)) {
        de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl iControl = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl(parent, FONT, tooltipAffordanceString) {
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        return iControl;
    } else {
        return new DefaultInformationControl(parent, tooltipAffordanceString);
    }
}
项目:DarwinSPL    文件:DwprofileTextHover.java   
public boolean canReuse(IInformationControl control) {
    if (!super.canReuse(control)) {
        return false;
    }

    if (control instanceof IInformationControlExtension4) {
        String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
        ((IInformationControlExtension4) control).setStatusText(tooltipAffordanceString);
    }

    return true;
}
项目:DarwinSPL    文件:DwprofileQuickAssistAssistant.java   
public DwprofileQuickAssistAssistant(de.darwinspl.preferences.resource.dwprofile.IDwprofileResourceProvider resourceProvider, de.darwinspl.preferences.resource.dwprofile.ui.IDwprofileAnnotationModelProvider annotationModelProvider) {
    setQuickAssistProcessor(new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileQuickAssistProcessor(resourceProvider, annotationModelProvider));
    setInformationControlCreator(new AbstractReusableInformationControlCreator() {
        public IInformationControl doCreateInformationControl(Shell parent) {
            return new DefaultInformationControl(parent, (IInformationPresenter) null);
        }
    });
}
项目:DarwinSPL    文件:HyexpressionTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    if (eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl.isAvailable(parent)) {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl iControl = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl(parent, FONT, tbm);
        final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
        tbm.add(openDeclarationAction);
        final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();

        IInputChangedListener inputChangeListener = new IInputChangedListener() {
            public void inputChanged(Object newInput) {
                if (newInput == null) {
                    selectionProvider.setSelection(new StructuredSelection());
                } else if (newInput instanceof eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionDocBrowserInformationControlInput) {
                    eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionDocBrowserInformationControlInput input = (eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionDocBrowserInformationControlInput) newInput;
                    Object inputElement = input.getInputElement();
                    selectionProvider.setSelection(new StructuredSelection(inputElement));
                    // If there is an element of type EObject in the input element, the button to open
                    // the declaration will be set enable
                    boolean isEObjectInput = inputElement instanceof EObject;
                    openDeclarationAction.setEnabled(isEObjectInput);
                    if (isEObjectInput) {
                        String simpleName = inputElement.getClass().getSimpleName();
                        simpleName = simpleName.substring(0, simpleName.length() - 4);
                        openDeclarationAction.setText("Open " + simpleName);
                    } else                          openDeclarationAction.setText("Open Declaration");
                }
            }
        };
        iControl.addInputChangeListener(inputChangeListener);

        tbm.update(true);
        return iControl;
    } else {
        return new DefaultInformationControl(parent, true);
    }
}
项目:DarwinSPL    文件:HyexpressionTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
    if (eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl.isAvailable(parent)) {
        eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl iControl = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl(parent, FONT, tooltipAffordanceString) {
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        return iControl;
    } else {
        return new DefaultInformationControl(parent, tooltipAffordanceString);
    }
}
项目:DarwinSPL    文件:HyexpressionTextHover.java   
public boolean canReuse(IInformationControl control) {
    if (!super.canReuse(control)) {
        return false;
    }

    if (control instanceof IInformationControlExtension4) {
        String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
        ((IInformationControlExtension4) control).setStatusText(tooltipAffordanceString);
    }

    return true;
}
项目:DarwinSPL    文件:HyexpressionQuickAssistAssistant.java   
public HyexpressionQuickAssistAssistant(eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionResourceProvider resourceProvider, eu.hyvar.feature.expression.resource.hyexpression.ui.IHyexpressionAnnotationModelProvider annotationModelProvider) {
    setQuickAssistProcessor(new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionQuickAssistProcessor(resourceProvider, annotationModelProvider));
    setInformationControlCreator(new AbstractReusableInformationControlCreator() {
        public IInformationControl doCreateInformationControl(Shell parent) {
            return new DefaultInformationControl(parent, (IInformationPresenter) null);
        }
    });
}
项目:DarwinSPL    文件:HyvalidityformulaQuickAssistAssistant.java   
public HyvalidityformulaQuickAssistAssistant(eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaResourceProvider resourceProvider, eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.IHyvalidityformulaAnnotationModelProvider annotationModelProvider) {
    setQuickAssistProcessor(new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaQuickAssistProcessor(resourceProvider, annotationModelProvider));
    setInformationControlCreator(new AbstractReusableInformationControlCreator() {
        public IInformationControl doCreateInformationControl(Shell parent) {
            return new DefaultInformationControl(parent, (IInformationPresenter) null);
        }
    });
}
项目:DarwinSPL    文件:HyvalidityformulaTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    if (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl.isAvailable(parent)) {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl iControl = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl(parent, FONT, tbm);
        final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
        tbm.add(openDeclarationAction);
        final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();

        IInputChangedListener inputChangeListener = new IInputChangedListener() {
            public void inputChanged(Object newInput) {
                if (newInput == null) {
                    selectionProvider.setSelection(new StructuredSelection());
                } else if (newInput instanceof eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput) {
                    eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput input = (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput) newInput;
                    Object inputElement = input.getInputElement();
                    selectionProvider.setSelection(new StructuredSelection(inputElement));
                    // If there is an element of type EObject in the input element, the button to open
                    // the declaration will be set enable
                    boolean isEObjectInput = inputElement instanceof EObject;
                    openDeclarationAction.setEnabled(isEObjectInput);
                    if (isEObjectInput) {
                        String simpleName = inputElement.getClass().getSimpleName();
                        simpleName = simpleName.substring(0, simpleName.length() - 4);
                        openDeclarationAction.setText("Open " + simpleName);
                    } else                          openDeclarationAction.setText("Open Declaration");
                }
            }
        };
        iControl.addInputChangeListener(inputChangeListener);

        tbm.update(true);
        return iControl;
    } else {
        return new DefaultInformationControl(parent, true);
    }
}
项目:DarwinSPL    文件:HyvalidityformulaTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
    if (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl.isAvailable(parent)) {
        eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl iControl = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl(parent, FONT, tooltipAffordanceString) {
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        return iControl;
    } else {
        return new DefaultInformationControl(parent, tooltipAffordanceString);
    }
}
项目:DarwinSPL    文件:HyvalidityformulaTextHover.java   
public boolean canReuse(IInformationControl control) {
    if (!super.canReuse(control)) {
        return false;
    }

    if (control instanceof IInformationControlExtension4) {
        String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
        ((IInformationControlExtension4) control).setStatusText(tooltipAffordanceString);
    }

    return true;
}
项目:DarwinSPL    文件:HydatavalueQuickAssistAssistant.java   
public HydatavalueQuickAssistAssistant(eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueResourceProvider resourceProvider, eu.hyvar.dataValues.resource.hydatavalue.ui.IHydatavalueAnnotationModelProvider annotationModelProvider) {
    setQuickAssistProcessor(new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueQuickAssistProcessor(resourceProvider, annotationModelProvider));
    setInformationControlCreator(new AbstractReusableInformationControlCreator() {
        public IInformationControl doCreateInformationControl(Shell parent) {
            return new DefaultInformationControl(parent, (IInformationPresenter) null);
        }
    });
}