站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

Tab Control - NetBeans Architecture Questions - NetBeans API Javadoc (Current Development Version)

NetBeans Architecture Answers for Tab Control module

WARNING: answering questions version 1.24 rather than the current 1.29.

Interfaces table

Group of java interfaces
Interface NameIn/OutStabilitySpecified in What Document?
TabbedContainerAPIExportedFriend .../swing/tabcontrol/TabbedContainer.html

PopupSwitcherAPIExportedFriend .../swing/popupswitcher/package-summary.html

API contains classes used only by switchers accessible through main menu in "Window/Documents..." and "Go To/Recent Document". Besides this module the package is used from core/windows too. Classes contained in the package are rather general and therefore this package could be moved in the future. It is placed here only due to current modules dependencies. Consequently the package is not intended for external use.
For more information on SwitcherTable and SwitcherTableItem see a javadoc.

org.openide.awtImportedPrivate../org-openide-awt/overview-summary.html

The module is needed for compilation. The module is used during runtime. Specification version 6.2 is required.

org.openide.utilImportedPrivate../org-openide-util/overview-summary.html

The module is needed for compilation. The module is used during runtime. Specification version 7.8 is required.

org.openide.windowsImportedPrivate .../overview-summary.html

The module is needed for compilation. The module is used during runtime. Specification version 6.4 is required.

Group of property interfaces
Interface NameIn/OutStabilitySpecified in What Document?
nb.tabs.suppressCloseButtonExportedUnder Development

The system property nb.tabs.suppressCloseButton can be used to hide close buttons by default.


General Information

    Question (arch-what): What is this project good for?

    Answer: The tab control is a swing control used by NetBeans window system, similar in function to a JTabbedPane, which allows the user to see and select tabs that contain different components. It defines two GUI components: TabbedContainer (similar to JTabbedPane) and TabDisplayer, a generic component for displaying tabs which is not associated with any particular container. Several different types of UIs (view, editor, sliding) are provided, each of which is handled by a different UI delegate class; UI delegate subclasses designed to fit with Windows, Metal, Aqua and GTK look and feels are provided. TabbedContainerAPI
    PopupSwitcherAPI - API contains classes used only by switchers accessible through main menu in "Window/Documents..." and "Go To/Recent Document". Besides this module the package is used from core/windows too. Classes contained in the package are rather general and therefore this package could be moved in the future. It is placed here only due to current modules dependencies. Consequently the package is not intended for external use.
    For more information on SwitcherTable and SwitcherTableItem see a javadoc.

    Question (arch-overall): Describe the overall architecture.

    Answer: The Swing components in this package were carefully designed to be consistent with standard Swing components in their function, usage and ui registration mechanisms.

    Question (arch-usecases): Describe the main use cases of the new API. Who will use it under what circumstances? What kind of code would typically need to be written to use the module?

    Answer: Primary use cases are in the NetBeans window system, as top level containers in the main window; future use cases include providing a consistent UI for tabs in the property sheet, the component inspector and the output window, but this probably will not happen for 4.0.

    Question (arch-time): What are the time estimates of the work?

    Answer: NetBeans 4.0 feature freeze

    Question (arch-quality): How will the quality of your code be tested and how are future regressions going to be prevented?

    Answer: Unit tests for the assorted data models involved are included.

    Question (arch-where): Where one can find sources for your module?

    WARNING: Question with id="arch-where" has not been answered!

Project and platform dependencies

    Question (dep-nb): What other NetBeans projects and modules does this one depend on?

    Answer: None, it is a standalone library that could be used in other applications.

    The default answer to this question is:

    These modules are required in project.xml:

    • org.openide.awt - The module is needed for compilation. The module is used during runtime. Specification version 6.2 is required.
    • org.openide.util - The module is needed for compilation. The module is used during runtime. Specification version 7.8 is required.
    • org.openide.windows - The module is needed for compilation. The module is used during runtime. Specification version 6.4 is required.

    Question (dep-non-nb): What other projects outside NetBeans does this one depend on?

    Answer: None.

    Question (dep-platform): On which platforms does your module run? Does it run in the same way on each?

    Answer: Should be platform-independent, as it is just a Swing component.

    Question (dep-jre): Which version of JRE do you need (1.2, 1.3, 1.4, etc.)?

    Answer: 1.4.

    Question (dep-jrejdk): Do you require the JDK or is the JRE enough?

    Answer: JRE.

Deployment

    Question (deploy-jar): Do you deploy just module JAR file(s) or other files as well?

    Answer: Just a JAR.

    Question (deploy-nbm): Can you deploy an NBM via the Update Center?

    Answer: Yes.

    Question (deploy-shared): Do you need to be installed in the shared location only, or in the user directory only, or can your module be installed anywhere?

    Answer: Either.

    Question (deploy-packages): Are packages of your module made inaccessible by not declaring them public?

    Answer: No. There are three relevant packages - API for the tab control and tab displayer control, an "event" package for logical separation, and a third package which provides an SPI for alternate UI delegate implementation (however unlikely it is that a look and feel author will take the time to write a custom UI delegate for NetBeans windowing system).

    Question (deploy-dependencies): What do other modules need to do to declare a dependency on this one, in addition to or instead of the normal module dependency declaration (e.g. tokens to require)?

    Answer: Nothing.

Compatibility with environment

    Question (compat-i18n): Is your module correctly internationalized?

    Answer: Non-applicable - code that uses the tabbed container may provide localized strings for it to display. It has none of its own.

    Question (compat-standards): Does the module implement or define any standards? Is the implementation exact or does it deviate somehow?

    Answer: No.

    Question (compat-version): Can your module coexist with earlier and future versions of itself? Can you correctly read all old settings? Will future versions be able to read your current settings? Can you read or politely ignore settings stored by a future version?

    Answer: N/A; no persisted settings.

    Question (compat-deprecation): How the introduction of your project influences functionality provided by previous version of the product?

    WARNING: Question with id="compat-deprecation" has not been answered!

Access to resources

    Question (resources-file): Does your module use java.io.File directly?

    Answer: No.

    Question (resources-layer): Does your module provide own layer? Does it create any files or folders in it? What it is trying to communicate by that and with which components?

    Answer: No.

    Question (resources-read): Does your module read any resources from layers? For what purpose?

    Answer: No.

    Question (resources-mask): Does your module mask/hide/override any resources provided by other modules in their layers?

    Answer: No.

    Question (resources-preferences): Does your module uses preferences via Preferences API? Does your module use NbPreferences or or regular JDK Preferences ? Does it read, write or both ? Does it share preferences with other modules ? If so, then why ?

    WARNING: Question with id="resources-preferences" has not been answered!

Lookup of components


Execution Environment

    Question (exec-property): Is execution of your code influenced by any environment or Java system (System.getProperty) property? On a similar note, is there something interesting that you pass to java.util.logging.Logger? Or do you observe what others log?

    Answer: nb.tabs.suppressCloseButton -

    The system property nb.tabs.suppressCloseButton can be used to hide close buttons by default.

    Question (exec-component): Is execution of your code influenced by any (string) property of any of your components?

    Answer: There is an "orientation" property which is honored by one of the three UI types to display tabs on the sides or bottom of the container. It is a client property, since it is optional for the UI delegate to implement this functionality and only one UI type has a requirement for this behavior.

    Question (exec-ant-tasks): Do you define or register any ant tasks that other can use?

    WARNING: Question with id="exec-ant-tasks" has not been answered!

    Question (exec-classloader): Does your code create its own class loader(s)?

    Answer: No.

    Question (exec-reflection): Does your code use Java Reflection to execute other code?

    Answer: No.

    Question (exec-privateaccess): Are you aware of any other parts of the system calling some of your methods by reflection?

    Answer: No.

    Question (exec-process): Do you execute an external process from your module? How do you ensure that the result is the same on different platforms? Do you parse output? Do you depend on result code?

    Answer: No.

    Question (exec-introspection): Does your module use any kind of runtime type information (instanceof, work with java.lang.Class, etc.)?

    Answer: The displayed tabs are contained in a data model provided by the client. The "user object" of each element in the model may be a Component instance, or something else (in which case the client code must supply a ComponentConverter instance to find the correct component when an element is selected). The default implementation tests if the user object is a Component (which it always should be currently for NetBeans window system - a system of lazy loading of opened components based on ID's may be implemented in the future), and if it is not, returns null.

    Question (exec-threading): What threading models, if any, does your module adhere to? How the project behaves with respect to threading?

    Answer: All access must be on the AWT thread; this is enforced with assertions in some cases.

    Question (security-policy): Does your functionality require modifications to the standard policy file?

    Answer: No.

    Question (security-grant): Does your code grant additional rights to some other code?

    Answer: No.

Format of files and protocols

    Question (format-types): Which protocols and file formats (if any) does your module read or write on disk, or transmit or receive over the network? Do you generate an ant build script? Can it be edited and modified?

    Answer: N/A

    Question (format-dnd): Which protocols (if any) does your code understand during Drag & Drop?

    Answer: N/A

    Question (format-clipboard): Which data flavors (if any) does your code read from or insert to the clipboard (by access to clipboard on means calling methods on java.awt.datatransfer.Transferable?

    Answer: None.

Performance and Scalability

    Question (perf-startup): Does your module run any code on startup?

    Answer: No.

    Question (perf-exit): Does your module run any code on exit?

    Answer: No.

    Question (perf-scale): Which external criteria influence the performance of your program (size of file in editor, number of files in menu, in source directory, etc.) and how well your code scales?

    Answer: Availability of hardware graphics acceleration to Java2D on look and feels other than Metal, some of which use GradientPaint and AlphaComposite and BufferedImage objects.

    Question (perf-limit): Are there any hard-coded or practical limits in the number or size of elements your code can handle?

    Answer: No. Different GUI types have different scalability characterisitics, in accordance with their intended uses - editor tabs are designed to be very lightweight and scalable, as there may be many; view tabs are less scalable (but the ui design for view tabs also doesn't scale - all tabs are displayed in a row and clipped if they don't fit); sliding tabs, actually create one JButton per tab, making them the least scalable.

    Question (perf-mem): How much memory does your component consume? Estimate with a relation to the number of windows, etc.

    Answer: Not measured. No more than a similar usage of JTabbedPane, possibly less, discounting for the higher number of classes loaded.

    Question (perf-wakeup): Does any piece of your code wake up periodically and do something even when the system is otherwise idle (no user interaction)?

    Answer: No.

    Question (perf-progress): Does your module execute any long-running tasks?

    Answer: No.

    Question (perf-huge_dialogs): Does your module contain any dialogs or wizards with a large number of GUI controls such as combo boxes, lists, trees, or text areas?

    Answer: No.

    Question (perf-menus): Does your module use dynamically updated context menus, or context-sensitive actions with complicated and slow enablement logic?

    Answer: No.

    Question (perf-spi): How the performance of the plugged in code will be enforced?

    Answer: It is highly unlikely that any look and feel will provide its own UI delegates for the tab control. In the event that they do, it is up to the look and feel author to ensure adequate performance.

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.