core

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » core 
License:
URL:
Description:
Package NameComment
org.netbeans.core.api.multiview This API allows to access the multiview component's content.

To query if a TopComponent is a multiview component, use {@link org.netbeans.core.api.multiview.MultiViews#findMultiViewHandler}. If a {@link org.netbeans.core.api.multiview.MultiViewHandler} instance is returned, it is a multiview component.
MultiViewHandler can be used to examine the multiview component.
Array of defined perspectives (elements) and the currently selected perspective are available. 
The handler can be used to switch the current selection programatically.

Possible usecases include:

  • Deciding wheather a certain TopComponentGroup shall be visible or not.
  • Etc.

org.netbeans.core.execution
org.netbeans.core.execution.beaninfo
org.netbeans.core.execution.beaninfo.editors
org.netbeans.core.multiview
org.netbeans.core.nativeaccess
org.netbeans.core.nativeaccess.transparency
org.netbeans.core.nativeaccess.transparency.dnd
org.netbeans.core.nativeaccess.transparency.unix
org.netbeans.core.nativeaccess.transparency.win32
org.netbeans.core.output2
org.netbeans.core.output2.ui
org.netbeans.core.spi.multiview This SPI handles the lifecycle of a multiview component.

Creation

New instance of MultiView TopComponent can be created by calling MultiViewFactory.createMultiView The resulting TopComponent can be docked in arbitrary mode at your convenience. The factory method requires an array of {@link org.netbeans.core.spi.multiview.MultiViewDescription}s that describe the content of the view.
Each description in the View shall have a unique display name and preferredId. All the descriptions shall be lightweight classes, which create the actual visual components on demand in {@link org.netbeans.core.spi.multiview.MultiViewDescription#createElement}
The multiview component is cloneable by default. If any of your embedded elements cannot be cloned, or you don't intend to allow the users to clone the component, please use the appropriate factory method to create a non-cloneable instance.

Lifecycle

Once the multiview component is opened, the element for the default MultiViewDescription is created. Creation of other Elements is delayed to the moment these are required.
All created Elements get notified of changes in the lifecycle of the multiview component and their own. The notification callback method have the same name and similar semantics as the TopComponent ones.
  • When the element is shown for the first time, componentOpened() is called.
  • Everytime the element is selected in the component, componentShowing() is called on the new selection and componentHidden() on the one deselected.
  • When focusing the whole component, the currently selected element receives componentActivated(). When switching elements, the element loosing focus gets called componentDeactivated(), the one gaining focus is called componentActivated()
  • Whenever the multiview component gets notified of it's state changes (showing/hidden/activate/deactivated) by the window system, these are propagated to the currently selected element only.
  • For all elements that were created during the lifecycle of the component, componentClosed() is called when the component is about to be closed. Closing the component is special because the elements can be in non-deterministic state and a dataloss  situation is possible. Each created MultiViewElement is queried for it's state, the environment calls {@link org.netbeans.core.spi.multiview.MultiViewElement#canCloseElement}. The owner of the multiview component resolves the problems (silently or by asking the user) in {@link org.netbeans.core.spi.multiview.CloseOperationHandler#resolveCloseOperation}

Persistence

TopComponents decide about persistence based on the TopComponent.getPersistenceType()  return values. Possible values are:
  • TopComponent.PERSISTENCE_ALWAYS,
  • TopComponent.PERSISTENCE_NEVER,
  • TopComponent.PERSISTENCE_ONLY_OPENED.
The multiview component decides what it's return value is based on the values returned by MultiViewDescription.getPersistenceType() of all  embedded MultiViewDescriptions. 
  • When at least one of them returns PERSISTENCE_ALWAYS, it is returned by the TopComponent as well.
  • If at least one requires PERSISTENCE_ONLY_OPENED and none needs PERSISTENCE_ALWAYS, the TopComponent's state will be stored only when it's opened on IDE exit.
  • The multiview topcomponent is not persisted if all descriptions return PERSISTENCE_NEVER, or any of the descriptions are not serializable.
In other words, ALWAYS has higher priority than ONLY_OPENED and NEVER has the lowest priority of all.

When the multiview's TopComponent gets persisted, all of it's {@link org.netbeans.core.spi.multiview.MultiViewDescription} instances get serialized. Thus they need to implement Serializable.  Then for all MultiViewDescriptions that were opened (created their {@link org.netbeans.core.spi.multiview.MultiViewElement} instances) and don't declare PERSISTENCE_NEVER in their getPersistenceType() method, the MultiViewElement instance gets persisted as well.
Note: If any of the MultiViewDescription instances is not Serializable, the TopComponent will not get persisted. Please note that even if your MultiViewDescription returns PERSISTENCE_NEVER, it should be possible to serialize the Description instance. After restoration the deserialized instance will create a fresh MultiViewElement instance.

If you define your own {@link org.netbeans.core.spi.multiview.CloseOperationHandler} implementation for the multiview component, then you also ought to define it Serializable.
When restoring the multiview TopComponent, all the MultiViewDescriptions are deserialized, also all the stored MultiViewElements are deserialized.  These are kept and the createElement() method is not called on the matching MultiViewDescription.

Manipulating the multiview

MultiViewElements get a chance to manipulate the enclosed topcomponent. Each of them is passed an instance of {@link org.netbeans.core.spi.multiview.MultiViewElementCallback} on creation or deserialization. (Please don't serialize with your element's data, for performance reasons) It can be used during lifecycle of the element.
  • To request activation.
  • To request visibility.
  • To get the default topcomponent actions (shall be used to contruct the Element's getActions() array).
  • To change the title for the topcomponent.

If your MultiViewElement is a TopComponent or provides a TopComponent in getVisualRepresentation(), you can manipulate the activatedNodes of the whole multiview component by setting the appropriate nodes on your own TopComponent. when elements are switched, the activated nodes get updated as well according to the shown element.

Embedding editors

A typical MultiViewElement for embedding editor extends CloneableEditor and delegates some of the functionality to the multiview component.
The multiview component implements CloneableEditorSupport.Pane and the CloneableEditorSupport instance's createPane() method shall return the overall multiview component, rather than the MultiViewElement's component. In such case the opening the component shall be always done using the openCloneableTopComponent() call which will register the MultiView component as a holder of the editor pane for that CloneableEditorSupport instance. The multiview component will always delegate to the currently selected element when communication with the editor support classes. Keep that in mind when trying to manipulate the editor pane. Always switch to the editor's element first.

Please note: The multiview component is just a placeholder for the enclosed components. Any data related synchronizations are to be performed in the client code. This is especially important when multiple elements work over the same data/files.

At least the requestActive() and requestVisible() methods shall be overriden to delegate to the MultiViewElementCallback. Sample code:
       public void requestActive() {
            if (multiViewCallback != null) {
                multiViewCallback.requestActive();
            } else {
                super.requestActive();
            }
        }

Since TopComponent's lifecycle callback methods (componentOpened(), componentShowing() etc) are defined with protected scope, you will have to redefine the to be public to be in synch with the MultiViewElement interface signature. If the lifecycle within the multiview component differs from the default behaviour, additional handling goes here as well.

To create the editor's toolbar, the one provided by the NbDocument.CustomToobar is the obvious choice.

       public JComponent getToolbarRepresentation() {
            if (toolbar == null) {
                JEditorPane pane = getEditorPane();
                if (pane != null) {
                    Document doc = pane.getDocument();
                    if (doc instanceof NbDocument.CustomToolbar) {
                        toolbar = ((NbDocument.CustomToolbar)doc).createToolbar(pane);
                    }
                }
                if (toolbar == null) {
                    //attempt to create own toolbar?
                    toolbar = new JPanel();
                }
            }
            return toolbar;
        }

The owner/creator of the multiview component is responsible to handle proper closing of the editor via the {@link org.netbeans.core.spi.multiview.CloseOperationHandler#resolveCloseOperation} method implementation.

org.netbeans.core.startup org.netbeans.core.modules package The IDE's module system is broken into several layers.

First there is the Open API: {@link org.openide.modules}. Relevant classes are {@link org.openide.modules.ModuleInfo}, giving general information about modules (version, name, etc.) and available through lookup; and {@link org.openide.modules.ModuleInstall}, permitting a module to customize its installation within limits.

In this package the remainder of the system is implemented, but this is still broken into pieces to make it easier to work with.

First {@link org.netbeans.core.modules.Module} is the concrete version of ModuleInfo, with additional information such as the full manifest contents, the live classloader in use, and some details of where it came from and its behavioral parameters.

{@link org.netbeans.core.modules.ModuleManager} is the class responsible for keeping track of the set of modules and their interdependencies, and ultimately controls which modules can or cannot be installed and why.

{@link org.netbeans.core.modules.ModuleInstaller} is the interface used by the manager to physically load the contents of the module into the IDE.

{@link org.netbeans.core.modules.Events} permits major events to be logged asynchronously for subsequent formatting and display.

Private helper classes include ChangeFirer to fire module manager changes, and Util for module-related utility functions. MultiURLClassLoader is an optimized classloader used for modules that is able to handle multiple parents, dynamic parent addition and removal, and streamlining of the package search algorithm based on features of the Modules API. Also the exceptions {@link org.netbeans.core.modules.DuplicateException} and {@link org.netbeans.core.modules.InvalidException} are thrown when creating or working with modules.

This layer is largely independent of the workings of the IDE; it uses some Open APIs but only those which can be used in a standalone context. So it makes sense to test these classes in isolation from the others, and without starting the IDE. It is not permitted to use UI and employs no localized messages. (Exception messages need not be localized; problems likely to be encountered by end users who are not module developers should be handled elsewhere are localized.)

The other layer is more dependent on the rest of the IDE core, and the details of the Modules API.

{@link org.netbeans.core.modules.NbInstaller NbInstaller} really implements the loading of modules: registering layers, registering the existence of help sets, loading the beans forming manifest sections and making them available, and running ModuleInstall methods.

{@link org.netbeans.core.modules.ManifestSection} is used by NbInstaller to represent one section in a module manifest during installation, and may be used in other parts of the core (e.g. if sections are registered via lookup for interpretation elsewhere).

{@link org.netbeans.core.modules.ModuleList} keeps track of the set of installed modules on disk, and is the point of contact for reading and writing the list of installed modules, any serialized ModuleInstall instances, and autoscanning the modules folder.

{@link org.netbeans.core.modules.ModuleHistory} tracks the origin of a module, whether it was installed before and where, and what version it last was. This information is supplied by ModuleList based on its knowledge of the settings on disk, and used by NbInstaller to invoke the correct ModuleInstall methods.

{@link org.netbeans.core.modules.NbEvents NbEvents} performs NetBeans-specific logging of module system events, such as displaying friendly messages in the splash screen, status bar, or console. It can also be a point of contact for performance measurements.

{@link org.netbeans.core.modules.ModuleSystem} is a high-level controller for the whole module system. Core initialization classes needing to start some process in the module system, such as "install newly found modules", should use a method call on this class, which will delegate the details to other module-system objects.

{@link org.netbeans.core.modules.TestModuleDeployer} is a service available via lookup which deploys test modules; accessible separately with a thin API for use by modules such as the API Support.

{@link AutomaticDependencies} is used to parse XML files constrained by module-auto-deps-1_0.dtd and automatically update dependencies used by old modules as a result. This is very useful for maintaining backward compatibility across major refactorings.

Also of interest: {@link org.netbeans.core.ui.ModuleBean} provides a Swing-safe UI wrapper for Module and ModuleManager, used by the Modules node.

Those interested in using the independent parts of the module system as a standalone JAR should run:

ant -f core/build.xml lib-modules
org.netbeans.core.startup.jars.cyclic-1.org.foo
org.netbeans.core.startup.jars.cyclic-2.org.bar
org.netbeans.core.startup.jars.dep-on-dep-on-simple.org.baz
org.netbeans.core.startup.jars.depends-on-cyclic-1.org.baz
org.netbeans.core.startup.jars.depends-on-library-src.org.dol
org.netbeans.core.startup.jars.depends-on-simple-module.org.bar
org.netbeans.core.startup.jars.exposes-api.org.netbeans.api.foo
org.netbeans.core.startup.jars.exposes-api.org.netbeans.modules.foo
org.netbeans.core.startup.jars.library-src.pkg.subpkg
org.netbeans.core.startup.jars.look-for-myself.lookformyself
org.netbeans.core.startup.jars.patch.pkg.subpkg
org.netbeans.core.startup.jars.patchable.pkg.subpkg
org.netbeans.core.startup.jars.prov-foo.org.prov_foo
org.netbeans.core.startup.jars.simple-module.org.foo
org.netbeans.core.startup.jars.uses-api.usesapi
org.netbeans.core.startup.jars.uses-api-transitively.usesapitrans
org.netbeans.core.startup.layers
org.netbeans.core.startup.preferences
org.netbeans.core.ui.options.general
org.netbeans.core.ui.sysopen
org.netbeans.core.ui.warmup
org.netbeans.core.windows
org.netbeans.core.windows.actions
org.netbeans.core.windows.awt
org.netbeans.core.windows.model
org.netbeans.core.windows.nativeaccess
org.netbeans.core.windows.options
org.netbeans.core.windows.persistence
org.netbeans.core.windows.services
org.netbeans.core.windows.view
org.netbeans.core.windows.view.dnd
org.netbeans.core.windows.view.ui
org.netbeans.core.windows.view.ui.slides
org.netbeans.core.windows.view.ui.tabcontrol
org.netbeans.core.windows.view.ui.toolbars
org.openide
org.openide.explorer
org.openide.explorer.propertysheet
org.openide.explorer.view
org.openide.filesystems
org.openide.filesystems.data
org.openide.filesystems.localfs
org.openide.filesystems.multifs
org.openide.filesystems.xmlfs
org.openide.loaders
org.openide.util
org.openide.util.enum
org.openide.util.lookup
org.openide.utildata
org.openide.windows
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.