mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
reflow text to new width
This commit is contained in:
+8
-4
@@ -778,7 +778,6 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr
|
||||
myEditorPane.setCaretPosition(0);
|
||||
}});
|
||||
}
|
||||
|
||||
private void showHint() {
|
||||
Editor editor = myManager.getEditor();
|
||||
Component popupAnchor = getPopupAnchor(editor);
|
||||
@@ -789,9 +788,14 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr
|
||||
Dimension preferredSize = myEditorPane.getPreferredSize();
|
||||
int width = definitionPreferredWidth();
|
||||
width = width < 0 ? preferredSize.width : width;
|
||||
width = Math.min(maxWidth, Math.max(JBUI.scale(300), width));
|
||||
myEditorPane.setBounds(0, 0, width, MAX_DEFAULT.height);
|
||||
myEditorPane.setText(myEditorPane.getText());
|
||||
preferredSize = myEditorPane.getPreferredSize();
|
||||
|
||||
int height = preferredSize.height + (needsToolbar() ? myControlPanel.getPreferredSize().height : 0);
|
||||
hintSize = new Dimension(Math.min(maxWidth, Math.max(JBUI.scale(300), width)),
|
||||
Math.min(MAX_DEFAULT.height, Math.max(MIN_DEFAULT.height, height)));
|
||||
height = Math.min(MAX_DEFAULT.height, Math.max(MIN_DEFAULT.height, height));
|
||||
hintSize = new Dimension(width, height);
|
||||
} else {
|
||||
hintSize = DimensionService.getInstance().getSize(DocumentationManager.NEW_JAVADOC_LOCATION_AND_SIZE, myManager.myProject);
|
||||
hintSize = hintSize != null ? hintSize : MIN_DEFAULT;
|
||||
@@ -883,7 +887,7 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr
|
||||
}
|
||||
myIsShown = true;
|
||||
if (myHint.getDimensionServiceKey() == null) {
|
||||
SwingUtilities.invokeLater(() -> registerSizeTracker());
|
||||
SwingUtilities.invokeLater(this::registerSizeTracker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user