首页 \ 问答 \ 如何在Eclipse中为所有文本编辑器更改字体大小?(How can I change font size in Eclipse for ALL text editors?)

如何在Eclipse中为所有文本编辑器更改字体大小?(How can I change font size in Eclipse for ALL text editors?)

我昨天不得不做演讲,作为演示的一部分,我使用Eclipse来显示一些代码。 我的许多同事在房间里看不到文本,并要求我增加所有文件的文本大小,而不仅仅是Java文件或XML文件。

但是从现有的选项来看,这并不是很明显的。 我在搜索输入中转到菜单窗口首选项和键入的字体 。 这样会将选项过滤到常规外观颜色和字体 。 从这里,我可以看到一个选项来更改Java文件中的字体,但是我不知道如何更改全局字体。

我在Windows上使用Eclipse v4.3服务版本1(开普勒)。

这类似于Stack Overflow问题如何在Java文本编辑器中更改字体大小?


I had to do a presentation yesterday, and as part of the presentation, I used Eclipse to show some code. Many of my coworkers in the room could not read the text and asked me to increase the size of the text for ALL files, not just Java files or XML files.

But it wasn't immediately obvious from the available options how to do this. I went to menu WindowPreferences and typed font in the search input. This filtered the options to GeneralAppearanceColors and Fonts. From here, I could see an option to change the font in Java files, but I didn't know how to change the font globally.

I'm using Eclipse v4.3 Service Release 1 (Kepler) on Windows.

This is similar to Stack Overflow question How can I change font size in Eclipse for Java text editors?.


原文:https://stackoverflow.com/questions/23272839
更新时间:2022-06-23 06:06

最满意答案

我搜索了cherrypy源代码,这是我发现的。 在_cptree.py模块中,您将找到Application类。 下面是一个Tree类,它有mount方法,我们用它来绑定应用程序(例如cherrypy.tree.mount(Root(), "/", config=config)

def mount(self, root, script_name="", config=None):
    ...

当您查看此方法时,您将看到下面的代码;

def mount(self, root, script_name="", config=None):
    ...
    if isinstance(root, Application):
        app = root
        if script_name != "" and script_name != app.script_name:
            raise ValueError(
                "Cannot specify a different script name and pass an "
                "Application instance to cherrypy.mount")
        script_name = app.script_name
    else:
        app = Application(root, script_name)

        # If mounted at "", add favicon.ico
        if (script_name == "" and root is not None
                and not hasattr(root, "favicon_ico")):
            favicon = os.path.join(os.getcwd(), os.path.dirname(__file__),
                                   "favicon.ico")
            root.favicon_ico = tools.staticfile.handler(favicon)

    if config:
        app.merge(config)

    self.apps[script_name] = app

因此,代码表明您传递给mount方法的每个对象(应用程序)都是Application实例或包装在Application实例中。 那么为什么会这样呢? 当您在Tree类上面检查Application类时,您将看到如下所示的__call__方法;

def __call__(self, environ, start_response):
    return self.wsgiapp(environ, start_response)

是的你现在看到它,它是wsgi接口。 因此, Application是一个wsgi包装器,适用于您的应用程序。 当你查看cherrypy的源代码时,你可能会学到很多东西。 我希望这个答案可以帮到你。


I searched the cherrypy source code and here is what I found. In _cptree.py module you will find the Application class. Below that, there is a Tree class which has mount method which we are used to binding applications with (e.g. cherrypy.tree.mount(Root(), "/", config=config))

def mount(self, root, script_name="", config=None):
    ...

When you look inside this method you will see the code below;

def mount(self, root, script_name="", config=None):
    ...
    if isinstance(root, Application):
        app = root
        if script_name != "" and script_name != app.script_name:
            raise ValueError(
                "Cannot specify a different script name and pass an "
                "Application instance to cherrypy.mount")
        script_name = app.script_name
    else:
        app = Application(root, script_name)

        # If mounted at "", add favicon.ico
        if (script_name == "" and root is not None
                and not hasattr(root, "favicon_ico")):
            favicon = os.path.join(os.getcwd(), os.path.dirname(__file__),
                                   "favicon.ico")
            root.favicon_ico = tools.staticfile.handler(favicon)

    if config:
        app.merge(config)

    self.apps[script_name] = app

So, the code says that every object (application) you pass to the mount method is either Application instance or wrapped in an Application instance. So why is that so? When you check Application class above Tree class, you will see a __call__ method like below;

def __call__(self, environ, start_response):
    return self.wsgiapp(environ, start_response)

Yes you see it now, it is wsgi interface. Therefore, Application is a wsgi wrapper for your cherrypy applications. When you check the source code of cherrypy you may learn lots of things. I hope this answer help you.

相关问答

更多
  • 我搜索了cherrypy源代码,这是我发现的。 在_cptree.py模块中,您将找到Application类。 下面是一个Tree类,它有mount方法,我们用它来绑定应用程序(例如cherrypy.tree.mount(Root(), "/", config=config) ) def mount(self, root, script_name="", config=None): ... 当您查看此方法时,您将看到下面的代码; def mount(self, root, script_name ...
  • 现在可以在config文件/ dict中的每个应用程序基础上进行设置 [/] response.headers.server = "CherryPy Dev01" Actually asking on IRC on their official channel fumanchu gived me a more clean way to do this (using latest svn): import cherrypy from cherrypy import _cpwsgi_server cla ...
  • 这个例子工作正常。 我确信freenode上的#gevent可以帮助您解决任何安装问题。 That example works fine. I'm sure #gevent on freenode would help you with any installation issues.
  • 您需要指定错误或访问日志文件名。 你可以在配置文件中这样做...... [global] log.error_file = 'Web.log' log.access_file = 'Access.log' 或者在Python文件中...... cherrypy.config.update({'log.error_file': Web.log, 'log.access_file': Access.log }) 我在想你得到一个“端口80不是免费 ...
  • 最后! 得到它自己 - 从手册... cherrypy.tree本身就是一个WSGI对象,所以你只需: cherrypy.tree.mount(...) cherrypy.tree.mount(...) cherrypy.tree.mount(...) application = cherrypy.tree Finally! Got it myself - from the manual... cherrypy.tree is itself a WSGI object so you simply do: ...
  • 以下是我检查我们的服务器生成的有效csrf令牌的post方法的方法。 def check_token(self=None): # whenever a user posts a form we verify that the csrf token is valid. if cherrypy.request.method == 'POST': token = cherrypy.session.get('_csrf_token') if token is None ...
  • 我意识到问题实际上是关于CORS预检请求 。 CORS 规范为简单的CORS请求定义了以下条件: 方法: GET , HEAD , POST 标题: Accept , Accept-Language , Content-Language , Content-Type Cotent类型标头值: application/x-www-form-urlencoded , multipart/form-data , text/plain 否则CORS请求并不简单,并在实际请求之前使用预检OPTIONS请求以确保其符合 ...
  • 在简单的情况下,您只需管理server.thread_pool配置参数,就像在问题的评论中提到的那样。 在实际情况中,它取决于许多因素。 但我可以肯定地说,CherryPy是一个线程服务器,由于Python GIL,一次只运行一个线程。 对于IO绑定工作负载来说,这可能不是一个大问题,但无论如何,您可以利用运行同一应用程序的许多CherryPy进程的CPU核心。 它可能会规定一些设计决策,例如避免进程内缓存,并且通常遵循无共享体系结构,因此您的进程可以互换使用。 拥有许多应用程序实例会使维护变得更加复杂,因 ...
  • 阅读: http://blog.dscpl.com.au/2015/01/using-alternative-wsgi-servers-with.html 您可以提供app.py文件以覆盖默认Apache / mod_wsgi的使用。 Have a read of: http://blog.dscpl.com.au/2015/01/using-alternative-wsgi-servers-with.html You can supply an app.py file to override the us ...
  • 事实证明,CherryPy生成的配置文件可以使用作为CherryPy的一部分提供的profiler.py脚本进行解释。 只需在/cherrypy/lib目录中运行profiler.py ,如下所示: python profiler.py /directory/containing/prof/files 8080 然后在浏览器中导航到localhost:8080 ,目标目录中所有.prof文件的分析结果将显示在一个简单的文本界面中。 我仍然希望能够使用KCacheGrind将结 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)