Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!
-
Recent Posts
Archives
Categories
Meta
Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!
As we are moving from eclipse3.1 to eclipse3.3 and beyond, the well-known Common Navigator Framework (CNF) are more commonly utilized to serve the needs of providing a robust and loosely coupled content view structure.
However, the inherent design of the CommonNavigator requests each of its instances maintain their action service and composing viewer separately. In other words, if we want to reuse the common viewer by instantiating one outside of its Navigator scope like wizard page or JFace dialog, we would encounter the bottleneck of reusing the viewer’s associated action service.
Therefore, to achieve adding context menu to a reused common viewer, we have to programmatically constitute the context menu and hook up action service from the navigator.
The following code snippet simply returns an instance of CommonViewer for reuse purpose.
public static CommonViewer createEEViewer(Composite content, int aStyle) {CommonViewer commonViewer = new CommonViewer(SuadeServersPlugin.SERVERS_VIEW_VIEWER_ID, content, aStyle);return commonViewer;}
After getting the CommonViewer, we have to programmatically create a context menu manager, get the actionService from the Navigator, and hook it into the context menu. The following section illustrate how to implement a context menu on CommonViewer in a wizard page.
private void createContextMenu(final CommonViewer viewer) {MenuManager menuMgr = new MenuManager();menuMgr.setRemoveAllWhenShown(true);menuMgr.addMenuListener(new IMenuListener() {CommonNavigator eeView = (CommonNavigator) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(SuadeServersPlugin.SERVERS_VIEW_VIEWER_ID);public void menuAboutToShow(IMenuManager manager) {ISelection selection = viewer.getSelection();eeView.getNavigatorActionService().setContext(new ActionContext(selection));eeView.getNavigatorActionService().fillContextMenu(manager);}});Menu menu = menuMgr.createContextMenu(viewer.getTree());viewer.getTree().setMenu(menu);}
IExtensionStateModel is a fairly useful feature in Common Navigator Framework that we could make use of when dealing with multiple content provider.
It allows clients to coordinate state across components that are part of the same logical extension.[1]
That is, a content provider might vary how it exposes its content based on the state of a specific property in the model. Interested parties may add themselves as IPropertyChangeListener to track changes in the state model.
For example, if we want multiple content provider to take instant adjustments and refresh themselves within a specific scope of tree structure and based on a centralized state change, say a Boolean value on one extension, we could simply register a Boolean value to a specific IExtensionStateModel of the sharing content service
public void init(IViewPart view) {
this.view = view;if (view instanceof CommonNavigator) {IExtensionStateModel stateModel = ((CommonNavigator)view).getNavigatorContentService().findStateModel(DSEPlugin.SERVERS_VIEW_CONTENT_EXTENSION_ID);stateModel.setBooleanProperty(DSEPlugin.PROP_SHOW_CATEGORIES,currentState);}}/** The state model stores properties associated with the extension. Each* content extension has its own contained state model. Components of the* extension (content provider, label provider, action providers, etc) may* attach themselves as listeners to the model* and respond to changes to the values of the properties.** @param anExtensionId* The extension id defined by a navigatorContent* extension.* @return The state model for the given extension id.*/IExtensionStateModel findStateModel(String anExtensionId);
Then IPropertyChangeListener could be added from another contentProvider to receive notification on the state model change, and take corresponding adjustments.
private IPropertyChangeListener mPropertyChangeListener = new IPropertyChangeListener() {public void propertyChange(PropertyChangeEvent event) {//DO something}};if (mViewer instanceof CommonViewer) {IExtensionStateModel stateModel = ((CommonViewer) mViewer).getNavigatorContentService().findStateModel(DSE_VIEW_CONTENT_EXTENSION_ID);stateModel.addPropertyChangeListener(mPropertyChangeListener);}
[1] Eclipse Platform API specification – IExtensionStateModel
|
|
Level: Advanced Contributors: BEA Systems, IBM, IONA, Oracle, SAP AG, Siebel Systems, Sybase In response to requests from customers and Independent Software Vendor (ISV) partners, BEA, IBM, IONA, Oracle, SAP, Siebel Systems, and Sybase are collaborating on specifications for building systems that use a Service-Oriented Architecture (SOA), which aim to provide developers with simpler and more powerful ways of constructing applications based on SOA. These specifications are published under royalty-free terms. Service Component Architecture: Build systems using SOA Service Component Architecture (SCA) is a set of specifications which describe a model for building applications and systems using a Service-Oriented Architecture. SCA extends and complements prior approaches to implementing services, and SCA builds on open standards such as Web services. SCA encourages an SOA organization of business application code based on components that implement business logic, which offer their capabilities through service-oriented interfaces and which consume functions offered by other components through service-oriented interfaces, called service references. SCA divides up the steps in building a service-oriented application into two major parts:
SCA emphasizes the decoupling of service implementation and of service assembly from the details of infrastructure capabilities and from the details of the access methods used to invoke services. SCA components operate at a business level and use a minimum of middleware APIs. SCA supports service implementations written using any one of many programming languages, both including conventional object-oriented and procedural languages such as Java™, PHP, C++, COBOL, XML-centric languages such as BPEL and XSLT, and also declarative languages such as SQL and XQuery. SCA also supports a range of programming styles, including asynchronous and message-oriented styles, in addition to the synchronous call-and-return style. SCA supports bindings to a wide range of access mechanisms used to invoke services. These include Web services, Messaging systems and CORBA IIOP. Bindings are handled declaratively and are independent of the implementation code. Infrastructure capabilities, such as Security, Transactions and the use of Reliable Messaging are also handled declaratively and are separated from the implementation code. SCA defines the usage of infrastructure capabilities through the use of Policies, which are designed to simplify the mechanism by which the capabilities are applied to business systems. SCA also promotes the use of Service Data Objects to represent the business data that forms the parameters and return values of services, providing uniform access to business data to complement the uniform access to business services offered by SCA itself. The SCA specification is divided into a number of documents, each dealing with a different aspect of SCA. The Assembly Model deals with the linking of components through wiring. The Assembly Model is independent of implementation language. The Client and Implementation specification deals with the implementation of services and of service clients — each implementation language has its own Client and Implementation specification, which describes the SCA model for that language. The current SCA specifications are published at a version 0.9 level, indicating that the specifications are not in their final form. The specifications are published with the intent of getting feedback from the community in order to ensure that the eventual version 1.0 level of the specifications more fully meets the needs of developers and businesses. |
To create and run an LDAP server, you must first download and install OpenLDAP to your hard-disk.
After installation, you need to do some configuration settings:
If success, you will be able to browse the results through "ldapsearch -x -b ‘dc=sybase,dc=com’ ‘(objectclass=*)"
mySQL乱码问题分析解决:
不查manual的话,这最后的一条还真是很难想到。
实际项目过程中确实会碰到许多问题并逐步发掘到需要学习的东西,“实践中学习”这句话说得还是极其有道理的。
prospective topic next week — hibernate + struts应用的lazyinitialization问题