org.eclipse.jface.text.IInformationControlExtension3 Java Examples

The following examples show how to use org.eclipse.jface.text.IInformationControlExtension3. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AdditionalInfoController.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
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;
}