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

项目: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);
    }
}
项目: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-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);
    }
}
项目: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    文件: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);
    }
}
项目: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);
    }
}
项目: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    文件: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    文件: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    文件: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);
        }
    });
}
项目:DarwinSPL    文件:HydatavalueTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    if (eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl.isAvailable(parent)) {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl iControl = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl(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.dataValues.resource.hydatavalue.ui.HydatavalueDocBrowserInformationControlInput) {
                    eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueDocBrowserInformationControlInput input = (eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueDocBrowserInformationControlInput) 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    文件:HydatavalueTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
    if (eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl.isAvailable(parent)) {
        eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl iControl = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl(parent, FONT, tooltipAffordanceString) {
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        return iControl;
    } else {
        return new DefaultInformationControl(parent, tooltipAffordanceString);
    }
}
项目:DarwinSPL    文件:HymappingQuickAssistAssistant.java   
public HymappingQuickAssistAssistant(eu.hyvar.feature.mapping.resource.hymapping.IHymappingResourceProvider resourceProvider, eu.hyvar.feature.mapping.resource.hymapping.ui.IHymappingAnnotationModelProvider annotationModelProvider) {
    setQuickAssistProcessor(new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingQuickAssistProcessor(resourceProvider, annotationModelProvider));
    setInformationControlCreator(new AbstractReusableInformationControlCreator() {
        public IInformationControl doCreateInformationControl(Shell parent) {
            return new DefaultInformationControl(parent, (IInformationPresenter) null);
        }
    });
}
项目:DarwinSPL    文件:HymappingTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    if (eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl.isAvailable(parent)) {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl iControl = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl(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.mapping.resource.hymapping.ui.HymappingDocBrowserInformationControlInput) {
                    eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingDocBrowserInformationControlInput input = (eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingDocBrowserInformationControlInput) 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    文件:HymappingTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
    if (eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl.isAvailable(parent)) {
        eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl iControl = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl(parent, FONT, tooltipAffordanceString) {
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        return iControl;
    } else {
        return new DefaultInformationControl(parent, tooltipAffordanceString);
    }
}
项目:DarwinSPL    文件:HyconstraintsTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    if (eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl.isAvailable(parent)) {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl iControl = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl(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.constraint.resource.hyconstraints.ui.HyconstraintsDocBrowserInformationControlInput) {
                    eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsDocBrowserInformationControlInput input = (eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsDocBrowserInformationControlInput) 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    文件:HyconstraintsTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
    if (eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl.isAvailable(parent)) {
        eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl iControl = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl(parent, FONT, tooltipAffordanceString) {
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        return iControl;
    } else {
        return new DefaultInformationControl(parent, tooltipAffordanceString);
    }
}
项目:DarwinSPL    文件:HyconstraintsQuickAssistAssistant.java   
public HyconstraintsQuickAssistAssistant(eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsResourceProvider resourceProvider, eu.hyvar.feature.constraint.resource.hyconstraints.ui.IHyconstraintsAnnotationModelProvider annotationModelProvider) {
    setQuickAssistProcessor(new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsQuickAssistProcessor(resourceProvider, annotationModelProvider));
    setInformationControlCreator(new AbstractReusableInformationControlCreator() {
        public IInformationControl doCreateInformationControl(Shell parent) {
            return new DefaultInformationControl(parent, (IInformationPresenter) null);
        }
    });
}
项目:DarwinSPL    文件:HymanifestTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    if (eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl.isAvailable(parent)) {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl iControl = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl(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.mspl.manifest.resource.hymanifest.ui.HymanifestDocBrowserInformationControlInput) {
                    eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestDocBrowserInformationControlInput input = (eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestDocBrowserInformationControlInput) 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    文件:HymanifestTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
    if (eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl.isAvailable(parent)) {
        eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl iControl = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl(parent, FONT, tooltipAffordanceString) {
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return fInformationPresenterControlCreator;
            }
        };
        return iControl;
    } else {
        return new DefaultInformationControl(parent, tooltipAffordanceString);
    }
}
项目:DarwinSPL    文件:HymanifestQuickAssistAssistant.java   
public HymanifestQuickAssistAssistant(eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestResourceProvider resourceProvider, eu.hyvar.mspl.manifest.resource.hymanifest.ui.IHymanifestAnnotationModelProvider annotationModelProvider) {
    setQuickAssistProcessor(new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestQuickAssistProcessor(resourceProvider, annotationModelProvider));
    setInformationControlCreator(new AbstractReusableInformationControlCreator() {
        public IInformationControl doCreateInformationControl(Shell parent) {
            return new DefaultInformationControl(parent, (IInformationPresenter) null);
        }
    });
}