StringResourceEditor extends UserDataHolderBase implements FileEditor { @NotNull public static Font getFont(@NotNull String text, @NotNull Font defaultFont) { return getFont(text, defaultFont, StudioFlags.TRANSLATIONS_EDITOR_USE_LOGICAL_FONT.get()); } StringResourceEditor(@NotNull StringsVirtualFile file); @NotNull static Font getFont(@NotNull String text, @NotNull Font defaultFont); @NotNull StringResourceViewPanel getPanel(); @NotNull @Override JComponent getComponent(); @Nullable @Override JComponent getPreferredFocusedComponent(); @NotNull @Override String getName(); @NotNull @Override FileEditorState getState(@NotNull FileEditorStateLevel level); @Override void setState(@NotNull FileEditorState state); @Override boolean isModified(); @Override boolean isValid(); @Override void selectNotify(); @Override void deselectNotify(); @Override void addPropertyChangeListener(@NotNull PropertyChangeListener listener); @Override void removePropertyChangeListener(@NotNull PropertyChangeListener listener); @Nullable @Override BackgroundEditorHighlighter getBackgroundHighlighter(); @Nullable @Override FileEditorLocation getCurrentLocation(); @Nullable @Override StructureViewBuilder getStructureViewBuilder(); @Override void dispose(); @NotNull @Override String toString(); static final Icon ICON; static final String NAME; }
@Test public void getFontScalesFonts() { Font font = StringResourceEditor.getFont("", myFont, true); assertEquals(24, font.getSize()); }
@Test public void getFontDoesntScaleJBFonts() { Font font = JBFont.create(myFont); font = StringResourceEditor.getFont("", font, true); assertEquals(24, font.getSize()); }