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

项目:APICloud-Studio    文件:AdditionalInfoController.java   
protected Point computeSizeConstraints(Control subjectControl, IInformationControl informationControl)
{
    // at least as big as the proposal table
    Point sizeConstraint = super.computeSizeConstraints(subjectControl, informationControl);
    Point size = subjectControl.getShell().getSize();

    // AbstractInformationControlManager#internalShowInformationControl(Rectangle, Object) adds trims
    // to the computed constraints. Need to remove them here, to make the outer bounds of the additional
    // info shell fit the bounds of the proposal shell:
    if (fInformationControl instanceof IInformationControlExtension3)
    {
        Rectangle shellTrim = ((IInformationControlExtension3) fInformationControl).computeTrim();
        size.x -= shellTrim.width;
        size.y -= shellTrim.height;
    }

    if (sizeConstraint.x < size.x)
    {
        sizeConstraint.x = size.x;
    }
    if (sizeConstraint.y < size.y)
    {
        sizeConstraint.y = size.y;
    }
    sizeConstraint.y = 450;
    return sizeConstraint;
}