- 浏览: 209876 次
文章分类
最新评论
-
qinzl_1:
能举一些代码实例吗?
Apache VFS(2):文件的监听和监控 -
skyuck:
java9920 写道写得很清晰,很不错!我想问一下,如果可以 ...
Jackrabbit的简单节点定义文件格式 -
caoyangx:
roki 写道新书推荐!清华出版社新书《搜索引擎零距离》
购 ...
Apache Solr 介绍(1) -
PointOnLine:
再 顶 。
Apache VFS(4): 事件 -
PointOnLine:
再 顶 。
Apache VFS(3): 文件过滤器和选择器
They had a brief run of popularity as Yet Another Way To Store Settings a few years ago, around when the new window system was being conceived. They're not bad, but a bit baroque. The main point was to avoid loading classes or creating objects just to satisfy a test like "how many object instances are there of X", "does this folder/lookup/collection contain an instance of X". For NetBeans, where there are lots of classes, this sort of thing really does make a difference in performance. The observation was that huge amounts of classloading could be triggered just to find out that something was not actually of use to whatever code triggered it to be instantiated.
.settings files can be used for the same purposes as .instance files - as a way of indicating that the file represents some class that should be instantiated. The main difference is that by defining all of the superclasses and interfaces of the the object they represent, it is possible for the system to delay actually instantiating the object longer - more questions about the object can be answered by the system without creating it to answer those questions.
.settings files are typically not used for registering actions in the main menu and similar places, since these actions will need to be instantiated almost immediately anyway in order to determine if they should be enabled or not. A future API for declarative actions will possibly change that, but at present, it does neither harm more good, and .instance files are simpler (and for cases where the object will be instatiated immediately anyway, faster).
Some examples:
Declaring a system option as a .settings file from an XML layer
Have a layer entry such as this:<folder name="Services">
<file name="org-openide-text-PrintSettings.settings" url="PrintSettings.settings">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.core.Bundle"/>
<attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/openide/resources/printSettings.gif"/>
</file>
</folder>
Note the url attribute - it points to a file PrintSettings.settings which is in the same directory in the module jar as the layer file - it is a relative path. That settings file will look like this:
<?xml version="1.0"?>
<!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN" "http://www.netbeans.org/dtds/sessionsettings-1_0.dtd">
<settings version="1.0">
<instanceof class="java.beans.beancontext.BeanContextProxy"/>
<instanceof class="org.openide.util.SharedClassObject"/>
<instanceof class="org.openide.options.SystemOption"/>
<instanceof class="org.openide.options.ContextSystemOption"/>
<instanceof class="org.openide.text.PrintSettings"/>
<instance class="org.openide.text.PrintSettings"/>
</settings>
The two things to note are that the .settings file declares many of the relevant parent classes of the object (so it does not need to be instantiated just to see what kind of object it is), and the layer file declares the icon and a resource bundle (for the display name) as file attributes .
发表评论
-
Netbeans平台: 顶层组件
2007-06-25 15:09 2073Netbeans平台的顶层组件:org.openide.win ... -
Netbeans平台: 数据对象
2007-06-25 14:52 1447数据对象是文件对象的 ... -
Netbeans平台: .shadow文件
2007-06-25 10:59 1433Netbeans平台中, .shadow文件主要用于系统文件 ... -
Netbeans平台: 我该使用何种注册方式呢?
2007-06-25 09:49 2034我们知道在Netbeans平台中有四种注册/安装方式: ... -
Netbeans平台: 声明式的安装 VS 程序式的安装
2007-06-25 09:31 1701在很久很久以前, Netbeans中的大部分对象都是在启动的时 ... -
Netbeans平台: 模块是如何影响系统的?
2007-06-25 09:05 1378Netbeans平台中的模块包含两个重要的内容,一个是配置数据 ... -
Netbeans平台: 窗口系统
2007-06-22 17:04 2292Netbeans平台中窗口系统负责创建主应用窗口,能够在用户界 ... -
Netbeans平台: .instance文件
2007-06-22 16:32 1476Netbeans平台中有.instance文件这个概念. 实际 ... -
Netbeans平台: 文件对象
2007-06-22 16:10 1527Netbeans平台中的文件对象(FileObject)是存在 ... -
Netbeans平台: 文件的识别
2007-06-22 15:16 1702很多应用程序通过用户界面来显示目录和文件, Netbeans用 ... -
Netbeans平台:系统文件系统
2007-06-22 14:18 1786Netbeans平台中有一个概念: System FileSy ... -
Netbeans平台的API: 数据系统(Datasystem API)
2007-06-18 14:07 1317Netbeans平台的数据系统 ... -
Netbeans平台的API: 节点API(Node)
2007-06-18 10:37 2172Netbeans使用Node将JavaBeans或者其他具备属 ... -
Netbeans平台的API们
2007-06-18 10:05 2545Netbeans平台上开发富客户端需要仔细研究他的API,这里 ... -
Netbeans平台的一些概念和基础知识
2007-06-11 13:17 1579开发Netbeans RCP前需要一些基础知识: 原文 ... -
Visual Web Pack 的背后(1)
2007-04-02 10:02 70Visual Web Pack 大概是Netbeans5以来最 ... -
Two examples for Netbeans Platform Application
2007-01-30 16:33 1449http://www.ociweb.com/jnb/ ... -
Netbeans API
2007-01-18 17:29 105Netbeans API 是用来基于Netbeans平台开发R ... -
NetBeans中使用Java Persistence API
2006-12-26 15:20 101JPA是EJB3.0的规范之一。本文章将描述如何使用Netbe ... -
Visual Web Pack面板
2006-12-22 17:15 1786Visual Web Pack是Netbeans5.5的一个卖 ...
相关推荐
netbeans字体配置文件.netbeans字体配置文件netbeans字体配置文件.netbeans字体配置文件netbeans字体配置文件.netbeans字体配置文件netbeans字体配置文件.netbeans字体配置文件netbeans字体配置文件.netbeans字体...
在压缩包子文件的文件名称列表中仅列出 "org",这可能表示整个库的结构,其中包含了 `org.netbeans.lib.axtextra` 包下的所有源代码、类文件和其他资源。通常,这样的目录结构意味着库包含了多个类和相关支持文件,...
语言程序设计资料:第13章_开发工具:NetBeans的使用.ppt
《Pro.Netbeans.IDE.6.Rich.Client.Platform.Edition》是针对NetBeans IDE 6的深入教程,专注于富客户端平台(Rich Client Platform)的开发。NetBeans IDE是一款强大的开源集成开发环境,尤其在Java开发领域备受...
语言程序设计资料:NetBeans使用文档.doc
语言程序设计资料:NetBeans学习笔记.doc
- **Swing 在 NetBeans Platform 中的作用**:NetBeans Platform 6.9 提供了一个专门为 Swing 设计的应用程序框架,这意味着开发者可以利用平台提供的工具和服务来简化 Swing 应用程序的开发过程。 - **框架优势**:...
Netbeans.教程.doc
一共分两卷,这是第二部分。... you'll find what you need in this book to get started with the more vibrant, more productive extensible NetBeans platform project found on netbeans.org.
在使用Java-netbeans-7.rar这个压缩包时,解压后将得到NetBeans 7的安装文件,按照安装向导步骤即可完成安装。安装完成后,你可以开始利用NetBeans 7的全部功能来编写、调试和部署Java应用程序。无论是初学者还是...
《The Definitive Guide to NetBeans Platform 7》是一本由NetBeans官方网站提供的权威Java开发指南,这本书深入探讨了NetBeans Platform 7的各种特性和功能,旨在帮助开发者充分利用这一强大的开发平台进行应用程序...
总的来说,NetBeans.Platform.6.9.Developers.Guide提供了全面的指导,让开发者能够有效地利用NetBeans构建模块化、基于Petri网的任务管理应用。通过深入学习这个指南和实践其中的代码,开发者不仅可以提升在...
NetBeans 是一个流行的集成开发环境(IDE),它提供了一个功能强大且灵活的平台 для开发 Java 应用程序。在本教程中,我们将学习如何使用 NetBeans 创建一个 Java 应用程序,并编写用于测试的 JavaBean 和测试...
《NetBeans平台终极指南》是Heiko Böck编著的一本详尽的书籍,旨在为读者提供关于NetBeans平台的全面理解与深入洞察。本书不仅涵盖了NetBeans平台的基础概念和核心架构,还深入探讨了如何开发用户界面、利用标准...
- NetBeans支持创建、管理和组织多个项目,每个项目可以包含源代码、资源文件、库引用等。 - 它还支持版本控制系统如Git,方便团队协作和代码版本控制。 4. **Maven和Ant支持**: - 对于Java项目,NetBeans可以...
- **解决方案**:关闭不必要的背景任务,减少打开的文件数量,考虑增加系统的RAM。 #### 四、高级功能详解 - **版本控制集成**:NetBeans IDE 7 支持多种版本控制系统(如SVN、Git等),便于团队协作和代码管理。...
《Apress Pro NetBeans IDE 6 Rich Client Platform Edition (2008)》是一本专为开发者准备的指南,详细介绍了如何使用NetBeans IDE 6来构建富客户端平台应用程序。这本书由Apress出版社出版,旨在帮助程序员充分...